Skip to content
Updated Oct 6, 2026 by Pablo Coufal · Owner: analysisactiveentityconfluence-migration Edit on GitHub

Entity: clientEnpi ​

Entity Definition ​

  • Entity Name: clientEnpi
  • Entity Type: Database table
  • Description: Defines custom Energy Performance Indicators (EnPI) for a client. System-defined default EnPIs (total consumption, CO₂, renewable share, specific energy per m², energy per degree-day, specific CO₂ per m²) are not stored here — they are computed from gauge data. This entity stores only user-defined custom EnPIs added by the client. A clientEnmsTarget record can optionally reference an EnPI to express that the target is measured by that indicator.

Data Attributes Table ​

Attribute NameDescriptionData TypeDefault ValueRequired (= Nullable)UniqueFormatValidationsIndexExample
idPrimary keyUUIDGenerated in code (app layer)YesYesUUID v7-Primary Key018ed0b3-c298-7c7a-96d5-8b36f5a7f8d2
tenantIdTenant this record belongs to.UUID-YesNoUUID v7FK → tenant; must existname: idx_client_enpi_tenantId, type: btree018fa51f-fda1-79f4-8461-2cb8f1cabc10
clientIdClient this EnPI belongs toUUID-YesNoUUID v7FK → client; must exist — see clientname: idx_client_enpi_clientId, type: btree018fa51f-fda1-79f4-8461-2cb8f1cabc10
nameDisplay name of the EnPIString-YesNo-Non-empty; max 255 chars-Heat consumption per m²
formulaDescriptionHuman-readable description of the EnPI formula or calculation methodText-NoNo-Nullable-Total heat consumption / total floor area
unitUnit of the EnPI value (e.g. kWh/m², GJ/person)String-YesNo-Non-empty-kWh/m²
referenceVariableThe normalisation variable used in the denominator (e.g. areaEnergyReference, userCount, degreeDay)String-NoNo-Nullable-areaEnergyReference
isSystemDefaultTrue for system-defined EnPIs (computed, not stored as custom rows). Reserved for future use — currently all rows here are custom.BooleanfalseYesNo---false
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-2025-03-16T18:00:00Z
updatedAtTimestamp of the last update.Timestamp with time zonenow() — set in codeYesNoISO 8601 — YYYY-MM-DDTHH:mm:ss.SSSZCannot be null-2025-03-16T18:00:00Z
deletedAtTimestamp of soft deletion. Null means active. Once set, immutable.Timestamp with time zone-NoNoISO 8601 — YYYY-MM-DDTHH:mm:ss.SSSZImmutable once set. Active records: WHERE deletedAt IS NULL-2025-06-01T09:00:00Z
createdByIdentifier of the actor who created the recordString-YesNotype:actorNon-empty-user:018ed0b3-c298-7c7a-96d5-8b36f5a7f8d2
updatedByIdentifier of the actor who last updated the recordString-YesNotype:actorNon-empty-user:018ed0b3-c298-7c7a-96d5-8b36f5a7f8d2

Translation note: the name and formulaDescription example values were originally in Czech ("Spotřeba tepla na m²" and "Celková spotřeba tepla / celková plocha") — translated above. Please double-check.

Audited fields ​

Recorded on created (in full), updated (changed only) and deleted (in full): clientId, name, formulaDescription, unit, referenceVariable, isSystemDefault.

Excluded: none.

isSystemDefault is documented as reserved for future use (every current row is a custom, client-authored EnPI) — audited like any other column regardless, since the field is real and persisted today.

Not registered for entityName resolution — renders id-only in the audit trail (architecture 61-audit-log.md §7.4 in the code repo: a valid, permanent state, not a gap). If registered, name is the natural candidate.