Appearance
Entity: clientEnmsTarget
Entity Definition
- Entity Name:
clientEnmsTarget - Entity Type: Database table
- Description: Stores numerical and qualitative energy targets defined by a client as part of their ISO 50001 Energy Management System. A client can have multiple targets. Each target can optionally be linked to a
clientEnpirecord — the linked EnPI is the measurable indicator used to track progress toward that target. Targets without a linked EnPI are free-text goals tracked manually.
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_target_tenantId, type: btree | 018fa51f-fda1-79f4-8461-2cb8f1cabc10 |
| clientId | Client this target belongs to | UUID | - | Yes | No | UUID v7 | FK → client; must exist — see client | name: idx_client_enms_target_clientId, type: btree | 018fa51f-fda1-79f4-8461-2cb8f1cabc10 |
| enpiId | Optional link to the EnPI that measures progress toward this target. Null means the target is tracked manually without a system-computed indicator. | UUID | - | No | No | UUID v7 | FK → clientEnpi; nullable; onDelete SET NULL — see clientEnpi | name: idx_client_enms_target_enpiId, type: btree | 018ed0b3-c298-7c7a-96d5-8b36f5a7f8d2 |
| description | Human-readable description of the target | String | - | Yes | No | - | Non-empty; max 500 chars | - | Reduce electricity consumption by 15% relative to 2022 |
| targetValue | Numerical target value (in the unit of the linked EnPI, or a percentage if no EnPI is linked) | Float | - | No | No | - | Nullable | - | 85.0 |
| baselineValue | Reference baseline value from which the target is measured | Float | - | No | No | - | Nullable | - | 100.0 |
| baselineYear | Year of the baseline measurement | Integer | - | No | No | - | Nullable; 4-digit year | - | 2022 |
| targetYear | Year by which the target should be achieved | Integer | - | Yes | No | - | 4-digit year; must be ≥ current year at creation | - | 2028 |
| status | Current achievement status of the target | Enum | planned | Yes | No | Enum - EnmsTargetStatus | Must be a valid EnmsTargetStatus value | name: idx_client_enms_target_clientId_status, type: btree | inProgress |
| 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
descriptionexample value was originally in Czech ("Snížit spotřebu elektřiny o 15 % oproti roku 2022") — translated above. Please double-check.Ambiguity:
statusreferences "Enum - EnmsTargetStatus" as plain text with no linked Confluence page id (unlike most other enum references on sibling pages, which carry a smart link). The enum's actual value set (e.g. whether it includesplanned,inProgress,achieved,missed, etc.) could not be confirmed — only the default valueplannedand one example valueinProgressare known from this page. Recommend locating/creating theEnmsTargetStatusenum catalog page separately.
Audited fields
Recorded on created (in full), updated (changed only) and deleted (in full): clientId, enpiId, description, targetValue, baselineValue, baselineYear, targetYear, status.
Excluded: none.
Every entry would carry subjectEntityType = client / subjectEntityId = clientId — a client can have several targets, so (unlike clientEnms) this entity keeps its own row-level history rather than acting as a satellite read only through its parent.
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, description is the natural candidate — the human-readable label a person would recognize this target by; there is no separate name field.