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

Entity: buildingCalculatedConsumption ​

Entity Type: Database table

Description: Versioned, append-only record of a building's calculated (predicted/target) consumption or production, broken down by usage type. This entity does not use updatedAt/updatedBy/deletedAt — a revision is written as a brand-new row with its own validFrom; existing rows are never edited or removed in order to keep every historical value auditable. Production data (e.g. FVE) uses the same structure as consumption, distinguished only by usageType = production. For versioning/correction behaviour (how partial corrections to already-entered periods are resolved), see buildingCalculatedConsumption versioning.

Data Attributes Table ​

Attribute NameDescriptionData TypeDefault ValueRequired (= Nullable)UniqueFormatValidationsIndexExample
idPrimary key of the entityUUIDGenerated in code (app layer)YesYesUUID v7-Primary Key018ed0b3-c298-7c7a-96d5-8b36f5a7f8d2
tenantIdTenant this record belongs to.UUID-YesNoUUID v7Foreign Key → tenant; must exist-018fa51f-fda1-79f4-8461-2cb8f1cabc10
buildingIdThe building this calculated value belongs to.UUID-YesNoUUID v7Foreign Key → building; must exist-b2c3d4e5-…
usageTypeWhat the value represents.String (enum)-YesNoenumMust be one of the enum values-heating
periodStartStart of the period this value covers (inclusive).Date-YesNoYYYY-MM-DDMust be ≤ periodEnd-2026-01-01
periodEndEnd of the period this value covers (inclusive).Date-YesNoYYYY-MM-DDMust be ≥ periodStart-2026-01-31
valueThe calculated consumption or production value for this period and usageType.Decimal-YesNodecimal(12,2)--405.00
sourceWho/what produced this value — an auditor's calculation, or a user snapshot.String (enum)-YesNoenumMust be one of the enum values-userSnapshot
snapshotSourcePeriodFromWhen source = userSnapshot: the beginning of the period of the normalised-consumption average. When source = auditor → null.DatenullNoNoYYYY-MM-DDRequired (non-null) when source = userSnapshot; must be null when source = auditor-2023-01-01
snapshotSourcePeriodToWhen source = userSnapshot: the end of the period of the normalised-consumption average. When source = auditor → null.DatenullNoNoYYYY-MM-DDRequired (non-null) when source = userSnapshot; must be ≥ snapshotSourcePeriodFrom; must be null when source = auditor-2025-12-31
validFromThe date from which this record is the current value for its buildingId/usageType/period combination.Date-YesNoYYYY-MM-DDMust not be in the future-2026-07-30
legacyIdLegacy-system identifier; migration provenance.StringnullNoNo--UNIQUE (tenantId, legacySource, legacyId) WHERE legacyId IS NOT NULL9931
legacySourceWhich legacy table this record was migrated from.String (enum)nullNoNoenum: calculated_consumption, calculated_consumption_monthsMust be one of the listed values, or null(composite with legacyId above)calculated_consumption
createdAtTimestamp of when the record was created. Immutable after insert.Timestamp with time zonenow() — set in codeYesNoISO 8601 — YYYY-MM-DDTHH:mm:ss.SSSZCannot be null; cannot be modified after creation-2026-07-30T11:00:00Z
createdByIdentifier of the actor who created the record (user ID or system actor).String-YesNotype:actor — e.g. user:uuid or system:migrationNon-empty-user:018ed0b3-c298-7c7a-96d5-8b36f5a7f8d2

Note: this entity intentionally omits updatedAt, updatedBy and deletedAt from the standard trailing audit set — see Description above (append-only versioning via validFrom/createdAt).

Audited fields ​

Recorded on created (in full) only — this entity has no update or delete path (see Description): buildingId, usageType, value, periodStart, periodEnd, source, validFrom, snapshotSourcePeriodFrom, snapshotSourcePeriodTo, legacyId, legacySource.

Excluded: none.

Not registered for entityName resolution, and has no independent human-readable attribute to register — identified by its buildingId/usageType/period combination.