Appearance
Entity: contractItemAllowedTypeRate
Entity: contractItemAllowedTypeRate
Description: A pure validation join between contractItemType and contractItemRate, defining which pricing units are valid for a given line-item type (e.g. "vodné" may only be priced in Kč/m³, never Kč/MWh). Used to constrain the selectable rate options when a contractItem is created or edited.
Entity Type: database table
Note — no
tenantId(deviation #17). This entity intentionally has notenantId— it is structural metadata describing valid type/rate combinations, not tenant data.
Data Attributes Table
| Attribute Name | Description | Data Type | Default Value | Required (= Nullable) | Unique | Format | Validations | Index | Example |
|---|---|---|---|---|---|---|---|---|---|
id | Primary key of the entity. | UUID | Generated in code (app layer) | Yes | Yes | UUID v7 | - | Primary Key | 018ed0b3-c298-7c7a-96d5-8b36f5a7f8d2 |
contractItemTypeId | The line-item type this combination applies to. | UUID | - | Yes | No (unique only as part of the composite pair below) | UUID v7 | Foreign Key: contractItemType; must exist | - | 018ed0b3-c298-7c7a-96d5-8b36f5a7f8d2 |
contractItemRateId | The pricing unit allowed for this line-item type. | UUID | - | Yes | No (unique only as part of the composite pair below) | UUID v7 | Foreign Key: contractItemRate; must exist | - | 018ed0b3-c298-7c7a-96d5-8b36f5a7f8d2 |
createdAt | Timestamp of entity creation. Immutable. | timestamp with time zone | now() | Yes | No | ISO 8601 — YYYY-MM-DDTHH:mm:ss.SSSZ | - | - | 2026-01-15T09:00:00Z |
updatedAt | Timestamp of last entity update. Mutable. | timestamp with time zone | now() | Yes | No | ISO 8601 — YYYY-MM-DDTHH:mm:ss.SSSZ | - | - | 2026-01-15T09:00:00Z |
deletedAt | Timestamp of entity soft delete. Once set, immutable. | timestamp with time zone | - | No | No | ISO 8601 — YYYY-MM-DDTHH:mm:ss.SSSZ | Immutable once set. Active records: WHERE deletedAt IS NULL | - | null |
createdBy | Identifier of the author who created this record. | string | - | Yes | No | type:actor | - | - | user:c2d3f586-1c9a-4f5f-b9ae-45f2c4f69f7e |
updatedBy | Identifier of the author who last updated this record. | string | - | Yes | No | type:actor | - | - | system:migration-v1 |
Composite uniqueness. The combination (
contractItemTypeId,contractItemRateId) must be unique among active (non-deleted) records. This requires its own composite unique constraint (implemented as a unique index by the database) — this is a data-integrity requirement, not a query-performance index, and is kept regardless of table size.
Note — indexing. Beyond the composite uniqueness constraint above, no additional single-column indexes on
contractItemTypeIdorcontractItemRateIdare defined. This is a small, global validation table (well under a few hundred rows) — a sequential scan is not a performance concern.
Audited fields
Recorded on created (in full) and deleted (in full) — a pure validation join between two catalogues; there is no field on an existing pairing that could be changed, only added or removed: contractItemTypeId, contractItemRateId.
Excluded: none.
No subjectEntityType/subjectEntityId — this is global structural metadata (no tenantId, per this entity's own deviation note), not filed against a tenant-owned record.
Not registered for entityName resolution — a validation/join row (contractItemTypeId × contractItemRateId), not a named record.