Appearance
Entity: clientEnms
Entity Definition
- Entity Name:
clientEnms - Entity Type: Database table (1:1 with client)
- Description: Stores the ISO 50001 Energy Management System configuration for a client. One record per client; created automatically when the
iso50001module is enabled viaPATCH /v1/clients/:id— the system atomically creates aclientEnmsrecord withisCertified = falseand all optional fields null. Holds certification data, free-text policy description and SEU method configuration. EnPI definitions are stored in the separate clientEnpi entity. Targets are stored in clientEnmsTarget.
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_enms_tenantId, type: btree | 018fa51f-fda1-79f4-8461-2cb8f1cabc10 |
| clientId | Client this EnMS record belongs to (1:1) | UUID | - | Yes | Yes | UUID v7 | FK → client; must exist; unique — see client | name: idx_client_enms_clientId, type: btree (unique) | 018fa51f-fda1-79f4-8461-2cb8f1cabc10 |
| isCertified | Whether the client holds an active ISO 50001 certification | Boolean | false | Yes | No | - | - | - | true |
| certificationDate | Date of initial ISO 50001 certification. Required when isCertified = true. | Date | - | No | No | ISO 8601 — YYYY-MM-DD | Nullable | - | 2022-03-15 |
| lastRecertificationDate | Date of most recent re-certification | Date | - | No | No | ISO 8601 — YYYY-MM-DD | Nullable | - | 2025-03-10 |
| certificateValidTo | Date until which the current certificate is valid | Date | - | No | No | ISO 8601 — YYYY-MM-DD | Nullable | - | 2028-03-10 |
| certifyingBody | Name of the certification body | String | - | No | No | - | Nullable | - | Bureau Veritas |
| policyDescription | Free-text description of the EnMS policy and organisational targets | Text | - | No | No | - | Nullable | - | Reduce energy consumption by 20% by 2030. |
| seuMethod | Method used to determine which buildings qualify as Significant Energy Use | Enum | - | No | No | See Enum - SeuMethod | Nullable; must be a valid SeuMethod value if set | - | topN |
| seuMethodParameter | Numeric parameter for the SEU method (e.g. N for topN, percentage threshold for percentageThreshold or coverageTarget) | Float | - | No | No | - | Nullable; required when seuMethod is set; positive number | - | 5 |
| seuMethodDescription | Free-text description of the SEU determination methodology | Text | - | No | No | - | Nullable | - | Top 5 buildings by electricity consumption. |
| 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
policyDescriptionandseuMethodDescriptionexample values were originally in Czech ("Snížit spotřebu energie o 20 % do 2030." and "TOP 5 objektů podle spotřeby elektřiny.") — translated above to English for consistency with this repo's DAT convention. Please double-check the translation reads naturally; these are illustrative example values, not authoritative product copy.
Audited fields
Recorded on created (in full), updated (changed only) and deleted (in full): clientId, isCertified, certificationDate, lastRecertificationDate, certificateValidTo, certifyingBody, policyDescription, seuMethod, seuMethodParameter, seuMethodDescription.
Excluded: none.
Every entry would carry subjectEntityType = client / subjectEntityId = clientId — clientEnms is a 1:1 satellite of client, not independently owned.
Not registered for entityName resolution — one row per client (clientId unique); described via the client it belongs to, not a name of its own.