Appearance
Entity: buildingParameter
Entity Type: Database table
Description: A versioned snapshot of physical parameters for a building. Each change to a tracked parameter (floor area, user count, reference temperature, etc.) creates a new record with a validFrom date rather than overwriting the previous value. This enables historical reports to use the parameter values that were valid during the reported period. The most current record is the one with the highest validFrom date that does not exceed the query date. A denormalised tenantId is stored so the table can carry a uniform Row-Level Security policy; the application keeps it consistent with the parent building (em3 architecture adaptation, SPEC desatero #2).
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 parameter snapshot belongs to. | UUID | - | Yes | No | UUID v4 | Foreign Key → building; must exist | name: idx_buildingParameter_buildingId_validFrom, type: btree (composite with validFrom DESC) | b2c3d4e5-… |
| tenantId | Tenant that owns this record. Denormalised from building so the table can carry a uniform Row-Level Security policy (defense-in-depth, SPEC desatero #2). Must equal the parent building's tenantId; enforced by the application on insert. | UUID | - | Yes | No | UUID v4 | Foreign Key → tenant; must exist; must equal parent building.tenantId | name: idx_buildingParameter_tenantId, type: btree | e5f6a7b8-… |
| validFrom | The date from which this parameter snapshot is valid. Records are applied to any report period that falls on or after this date, up to the next record's validFrom. | Date | - | Yes | No | YYYY-MM-DD | Must not be in the future; must be unique per buildingId (no two records for the same building on the same date) | name: idx_buildingParameter_buildingId_validFrom, type: btree (composite with buildingId) | 2024-01-01 |
| userCount | Number of active users of the building at this point in time. Migrated from legacy building_users_quantity.quantity. | Integer | null | No | No | - | Min 0 | - | 450 |
| areaEnergyReference | Total energy-reference floor area of the building (m²). Used for normalised consumption calculations. Migrated from legacy building_heated_area.area. | Decimal | null | No | No | decimal(10,2) | Min 0 | - | 3200.00 |
| areaUsable | Total usable floor area of the building (m²). Migrated from legacy building_usable_area.area. | Decimal | null | No | No | decimal(10,2) | Min 0 | - | 3800.00 |
| volumeEnclosed | Enclosed (built) volume of the building (m³) — obestavěný prostor. Migrated from legacy building_built_up_area.area, which EM2 labels Obestavěný prostor in m³ despite the table name. | Decimal | null | No | No | decimal(10,2) | Min 0 | - | 12500.00 |
| temperatureReference | Prevailing reference internal temperature used for degree-day normalisation (°C). Migrated from legacy building_templerature.temperature (note: typo in source table name). | Decimal | null | No | No | decimal(5,2) | Typical range 10–30 °C | - | 20.00 |
| lightPoints | Number of light points. Applicable to buildings of type publicLighting only. Migrated from legacy building_public_light_points.points. | Integer | null | No | No | - | Min 0; only valid when building.type = publicLighting | - | 320 |
| lightPointsPv | Number of light points equipped with photovoltaic panels. Applicable to publicLighting only. Migrated from legacy building_public_light_points_fve.points. | Integer | null | No | No | - | Min 0; must be ≤ lightPoints; only valid when building.type = publicLighting | - | 40 |
| legacyId | Legacy-system identifier; migration provenance. | String | null | No | No | - | - | - | 7743 |
| 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 |
Note: source page has no deletedAt column for this entity — versioning is achieved via validFrom, not soft-delete. Documented as given; not added.
Audited fields
Recorded on created (in full) only — this entity has no update or delete endpoint (see Description): buildingId, validFrom, areaEnergyReference, areaUsable, volumeEnclosed, userCount, temperatureReference, lightPoints, lightPointsPv, legacyId.
Excluded: none.
Not registered for entityName resolution, and has no independent human-readable attribute to register — identified by its buildingId/validFrom pair.