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

Entity: buildingEnergyBaseline ​

Entity Type: Database table

Description: The building's reference consumption at the point EnMS was introduced (referenceYear), reflecting real operation. Used to evaluate long-term targets and the overall benefit of EnMS. No history is required → one current row per building/medium is sufficient (new entry overwrites the previous one). Entered once by the energy manager at review time, supporting both manual entry and loading the value from existing data. Every row covers exactly one medium (medium is always set). There is no separate stored total-energy row — the building's total energy baseline is computed as SUM(value) across all active rows for that building/referenceYear wherever needed. If not all media used by a building are tracked in the system, the computed total will be understated.

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 baseline belongs to.UUID-YesNoUUID v7Foreign Key → building; must exist-b2c3d4e5-…
mediumEnergy medium this baseline value covers.String (enum)-YesNoenumOne of GaugeMedium enum values-heat
referenceYearThe reference year this baseline reflects — the year EnMS was introduced for this building.Integer-YesNoYYYYMust match referenceYear of all other active rows for the same buildingId. A per-medium write with a different year is rejected; the year is changed for the whole building at once (bulk reference-year change), which moves every active row and keeps value and source. Per-medium and bulk writes of one building are serialized, so its active rows always share one year.-2024
valueThe reference consumption for the given medium in the referenceYear.Decimal-YesNodecimal(12,2)--128500.00
sourceHow the value was populated.String (enum)manualYesNoenumMust be one of the enum values-manual
legacyIdLegacy-system identifier; migration provenance.StringnullNoNo--UNIQUE (tenantId, legacySource, legacyId) WHERE legacyId IS NOT NULL2214
legacySourceWhich legacy table this record was migrated from.String (enum)nullNoNoenum: building_energy_managemet (sic — misspelled in the migration itself)Must equal the listed value, or null(composite with legacyId above)building_energy_managemet
createdAtTimestamp of when the record was created.Timestamp with time zonenow() — set in codeYesNoISO 8601 — YYYY-MM-DDTHH:mm:ss.SSSZCannot be null-2026-07-30T11:00:00Z
updatedAtTimestamp of the last update to the record.Timestamp with time zonenow() — set in codeYesNoISO 8601 — YYYY-MM-DDTHH:mm:ss.SSSZCannot be null-2026-07-30T11:00:00Z
deletedAtTimestamp of soft deletion. Null means the record is active.Timestamp with time zonenullNoNoISO 8601 — YYYY-MM-DDTHH:mm:ss.SSSZImmutable once set-null
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
updatedByIdentifier of the actor who last updated the record (user ID or system actor).String-YesNotype:actor — e.g. user:uuid or system:migrationNon-empty-user:018ed0b3-c298-7c7a-96d5-8b36f5a7f8d2

Audited fields ​

Recorded on created (in full), updated (changed only) and deleted (in full): buildingId, medium, referenceYear, value, source, legacyId, legacySource.

Excluded: none.

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