Appearance
Entity: buildingCoefficient
Entity Type: Database table
Description: Originally specified as a versioned climate correction coefficient applied at the building level before Consumption records are written. Per the 2026-08-19 decision, climate correction (degree-day normalisation) is computed on demand from climateData/climateNormal and is not stored — so this entity's calculated source case no longer applies. If retained, its scope narrows to manual override only: an admin-entered correction for a specific building/period that takes precedence over the computed value. Climate input data for the computed value comes from the WeatherStation linked via building.climateStationId; this entity does not participate in that calculation.
Status under review (per source page, as of 2026-08-19). The climate correction this entity was designed to store is computed at read time from climateData + climateNormal and is not persisted (resolved F348 discussion). As a consequence this entity is very likely obsolete for the calculated source case. If this entity (or a migration for it) has already been implemented, do not drop it silently — raise a dedicated implementation ticket to remove/rework it, since that is a code and possibly data change, not just a documentation fix.
Data Attributes Table
| Attribute Name | Description | Data Type | Default Value | Required (= Nullable) | Unique | Format | Validations | Index | Example |
|---|---|---|---|---|---|---|---|---|---|
| id | Primary key of the entity | UUID | Generated | Yes | Yes | UUID v4 | - | Primary Key | a1b2c3d4-… |
| buildingId | The building this coefficient applies to. | UUID | - | Yes | No | UUID v4 | Foreign Key → building; must exist | name: idx_buildingCoefficient_buildingId_validFrom, type: btree (composite with validFrom DESC) | b2c3d4e5-… |
| validFrom | The date from which this coefficient is valid. Applied to all Consumption records on or after this date, up to the next record's validFrom. | Date | - | Yes | No | YYYY-MM-DD | Must be unique per buildingId (no two records for the same building on the same date) | name: idx_buildingCoefficient_buildingId_validFrom, type: btree (composite with buildingId) | 2024-01-01 |
| value | The coefficient value applied to raw consumption. A multiplier (e.g. 1.12 means +12% adjustment for a colder-than-reference period) or an additive correction, depending on normalisationMethod. | Decimal | - | Yes | No | decimal(10,6) | Must be > 0 for multiplier; any value for additive | - | 1.120000 |
| normalisationMethod | Defines how the coefficient value is applied to raw consumption. | Enum | multiplier | Yes | No | enum | multiplier / additive | - | multiplier |
| source | Indicates how the coefficient value was determined. | Enum | manual | Yes | No | - | manual / calculated | - | calculated |
| note | Optional free-text explanation of why this coefficient value was set (e.g. "unusually cold winter, adjusted for January–March"). | String | null | No | No | - | Max 500 characters | - | Cold spell Jan–Mar 2024, degree-day factor 1.12 |
| createdAt | Timestamp of when the record was created. | Timestamp | now() | Yes | No | YYYY-MM-DDTHH:mm:ss.SSS+00 | - | - | 2024-03-01T08:00:00.000+00 |
| updatedAt | Timestamp of the last update to the record. | Timestamp | now() | Yes | No | YYYY-MM-DDTHH:mm:ss.SSS+00 | - | - | 2024-06-15T14:22:00.000+00 |
| createdBy | Identifier of the actor who created the record (user ID or system). | String | system | Yes | No | - | Non-empty | - | user:a1b2c3d4 / system |
| updatedBy | Identifier of the actor who last updated the record (user ID or system). | String | system | Yes | No | - | Non-empty | - | user:a1b2c3d4 / system |
Discrepancies vs. the playbook (§3.2, §4, §5), preserved faithfully from the source page rather than silently fixed:
- No
tenantIdcolumn, though the playbook's identity-columns rule requires it on every entity. Not added here — flagged for follow-up. - No
deletedAtcolumn, though the standard audit quintet includes it. Not added here — flagged for follow-up. iduses UUID v4 in the source page rather than the playbook's UUID v7 convention (§4). Documented as given.- Index names in the source use camelCase (
idxBuildingCoefficientBuildingValid) rather than the playbook'sidx_entity_attributesnake_case pattern; renamed here to match the playbook, semantics unchanged.
Audited fields
Recorded on created (in full), updated (changed only) and deleted (in full): buildingId, validFrom, value, normalisationMethod, source, note.
Excluded: none.
Per this entity's own status note, its calculated source case is very likely obsolete (climate correction is now computed on demand from climateData/climateNormal, not stored here) — if the entity is dropped or reworked, this section should be revisited alongside it rather than left describing a removed table.
Not registered for entityName resolution, and has no independent human-readable attribute to register — identified by its buildingId/validFrom pair.