Appearance
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
clientEnmsTargetrecord can optionally reference an EnPI to express that the target is measured by that indicator.
Data Attributes Table
| Attribute Name | Description | Data Type | Default Value | Required (= Nullable) | Unique | Format | Validations | Index | Example |
|---|---|---|---|---|---|---|---|---|---|
| id | Primary key | UUID | Generated in code (app layer) | Yes | Yes | UUID v7 | - | Primary Key | 018ed0b3-c298-7c7a-96d5-8b36f5a7f8d2 |
| tenantId | Tenant this record belongs to. | UUID | - | Yes | No | UUID v7 | FK → tenant; must exist | name: idx_client_enpi_tenantId, type: btree | 018fa51f-fda1-79f4-8461-2cb8f1cabc10 |
| clientId | Client this EnPI belongs to | UUID | - | Yes | No | UUID v7 | FK → client; must exist — see client | name: idx_client_enpi_clientId, type: btree | 018fa51f-fda1-79f4-8461-2cb8f1cabc10 |
| name | Display name of the EnPI | String | - | Yes | No | - | Non-empty; max 255 chars | - | Heat consumption per m² |
| formulaDescription | Human-readable description of the EnPI formula or calculation method | Text | - | No | No | - | Nullable | - | Total heat consumption / total floor area |
| unit | Unit of the EnPI value (e.g. kWh/m², GJ/person) | String | - | Yes | No | - | Non-empty | - | kWh/m² |
| referenceVariable | The normalisation variable used in the denominator (e.g. areaEnergyReference, userCount, degreeDay) | String | - | No | No | - | Nullable | - | areaEnergyReference |
| isSystemDefault | True for system-defined EnPIs (computed, not stored as custom rows). Reserved for future use — currently all rows here are custom. | Boolean | false | Yes | No | - | - | - | false |
| createdAt | Timestamp of when the record was created. Immutable after insert. | Timestamp with time zone | now() — set in code | Yes | No | ISO 8601 — YYYY-MM-DDTHH:mm:ss.SSSZ | Cannot be null; cannot be modified after creation | - | 2025-03-16T18:00:00Z |
| updatedAt | Timestamp of the last update. | Timestamp with time zone | now() — set in code | Yes | No | ISO 8601 — YYYY-MM-DDTHH:mm:ss.SSSZ | Cannot be null | - | 2025-03-16T18:00:00Z |
| deletedAt | Timestamp of soft deletion. Null means active. Once set, immutable. | Timestamp with time zone | - | No | No | ISO 8601 — YYYY-MM-DDTHH:mm:ss.SSSZ | Immutable once set. Active records: WHERE deletedAt IS NULL | - | 2025-06-01T09:00:00Z |
| createdBy | Identifier of the actor who created the record | String | - | Yes | No | type:actor | Non-empty | - | user:018ed0b3-c298-7c7a-96d5-8b36f5a7f8d2 |
| updatedBy | Identifier of the actor who last updated the record | String | - | Yes | No | type:actor | Non-empty | - | user:018ed0b3-c298-7c7a-96d5-8b36f5a7f8d2 |
Translation note: the
nameandformulaDescriptionexample 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.