Appearance
Entity: contractGauge
Entity: contractGauge
Description: A pure structural link between a contract and a gauge (see Gauge Management), expressing which metering points are covered by a given contract. A contract with exactly one linked gauge represents an individual contract; a contract with multiple linked gauges represents a joint/bulk purchase group. Records are added when a gauge is assigned to a contract and hard-deleted when a gauge is removed from it — the link itself has no independent lifecycle beyond its existence.
Entity Type: database table
Note — no surrogate
id. This entity has a composite primary key (contractId,gaugeId) instead of a standaloneidcolumn, as documented on the source page.
Note — deliberate deviation from the standard audit column set. This entity carries only
createdAt/createdBy, not the fullupdatedAt/updatedBy/deletedAtset. The link is either present or absent — it is never "updated," and removal is a hard delete (removing a gauge from a contract group), not a soft delete. This differs from the append-only pattern (used e.g. byclimateData), which is about records that are never modified and never deleted; here deletion is a normal, expected operation — only "update in place" doesn't apply.
Note — possible missing
tenantId. Unlike most entities in this catalog, this DAT (as authored in Confluence) does not include atenantIdcolumn, even thoughcontractitself is tenant-scoped. This may be an intentional omission (tenant scoping derivable via the parentcontract) or a gap in the original documentation — migrated faithfully as authored; flagging for review rather than adding a column not present in the source.
Data Attributes Table
| Attribute Name | Description | Data Type | Default Value | Required (= Nullable) | Unique | Format | Validations | Index | Example |
|---|---|---|---|---|---|---|---|---|---|
contractId | The contract this gauge is linked to. Part of the composite primary key. | UUID | - | Yes | Yes (composite) | UUID v7 | Foreign Key: contract; must exist | Primary Key (composite) | 018ed0b3-c298-7c7a-96d5-8b36f5a7f8d2 |
gaugeId | The gauge covered by the contract. Part of the composite primary key. | UUID | - | Yes | Yes (composite) | UUID v7 | Foreign Key: gauge; must exist. A gauge may be linked to at most one contract per medium for any overlapping validity period (see contract.validFrom/validTo) | - | 018ed0b3-c298-7c7a-96d5-8b36f5a7f8d2 |
createdAt | Timestamp of when the gauge was added to the contract. Immutable. | timestamp with time zone | now() | Yes | No | ISO 8601 — YYYY-MM-DDTHH:mm:ss.SSSZ | - | - | 2026-01-15T09:00:00Z |
createdBy | Identifier of the actor who added this gauge to the contract. | string | - | Yes | No | type:actor | - | - | user:c2d3f586-1c9a-4f5f-b9ae-45f2c4f69f7e |
Note — indexing. No secondary index on
gaugeIdis defined, beyond what the composite primary key(contractId, gaugeId)already provides. Looking up "which contract covers this gauge" (e.g. on the gauge detail page) is a candidate for a dedicatedgaugeIdindex, but at current scale (~15,000 gauges, a few thousand contract-gauge links in total) a sequential scan is not a performance concern. This is the closest call among the new entities in this batch — reconsider if this lookup becomes a hot path at materially higher data volume.
Audited fields
N/A — contractGauge has no synthetic id and is never its own audited entity type. A gauge-link change (added/removed) is recorded as a diffed gaugeIds field on contract's own audit entry, by set difference between the loaded and incoming lists.
Not registered for entityName resolution — a join row (contract × gauge), not a named record of its own.