Skip to content
Updated Sep 26, 2026 by Barča Dvořáková · Owner: analysisactiveentityconfluence-migration Edit on GitHub

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 standalone id column, as documented on the source page.

Note — deliberate deviation from the standard audit column set. This entity carries only createdAt/createdBy, not the full updatedAt/updatedBy/deletedAt set. 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. by climateData), 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 a tenantId column, even though contract itself is tenant-scoped. This may be an intentional omission (tenant scoping derivable via the parent contract) 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 NameDescriptionData TypeDefault ValueRequired (= Nullable)UniqueFormatValidationsIndexExample
contractIdThe contract this gauge is linked to. Part of the composite primary key.UUID-YesYes (composite)UUID v7Foreign Key: contract; must existPrimary Key (composite)018ed0b3-c298-7c7a-96d5-8b36f5a7f8d2
gaugeIdThe gauge covered by the contract. Part of the composite primary key.UUID-YesYes (composite)UUID v7Foreign 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
createdAtTimestamp of when the gauge was added to the contract. Immutable.timestamp with time zonenow()YesNoISO 8601 — YYYY-MM-DDTHH:mm:ss.SSSZ--2026-01-15T09:00:00Z
createdByIdentifier of the actor who added this gauge to the contract.string-YesNotype:actor--user:c2d3f586-1c9a-4f5f-b9ae-45f2c4f69f7e

Note — indexing. No secondary index on gaugeId is 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 dedicated gaugeId index, 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.