Appearance
Entity: buildingSchedule
Entity Type: Database table
Description: Structured operating schedule for a building, stored as a weekly 24×7 grid of 15-minute slots (672 slots per week). Used as the authoritative source for anomaly detection, control regime evaluation, and consumption analysis relative to operating hours. A building may have multiple schedule records over time (versioned via validFrom); the record with the highest validFrom not exceeding the evaluated timestamp is the active schedule for that period. The human-readable buildingEnergyProfile.operatingTime field is a non-binding complement — the structured schedule takes precedence in all system logic.
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-… |
| tenantId | Tenant that owns this record. Denormalised from building for uniform Row-Level Security (SPEC desatero #2). | UUID | - | Yes | No | UUID v4 | Foreign Key → tenant; must exist; must equal parent building.tenantId | - | e5f6a7b8-… |
| buildingId | The building this schedule applies to. | UUID | - | Yes | No | UUID v4 | Foreign Key → building; must exist | - | b2c3d4e5-… |
| validFrom | Date from which this schedule is active. The record with the highest validFrom not exceeding the evaluated timestamp is the active schedule for that period. | Date | - | Yes | No | YYYY-MM-DD | Must be unique per buildingId (no two records for the same building on the same date) | - | 2024-01-01 |
| slots | Weekly operating schedule stored as a bit array of 672 slots (7 days × 96 quarter-hours per day, starting Monday 00:00). A set bit (1) means the building is in operation during that 15-minute interval; an unset bit (0) means it is outside operating hours. Used by anomaly detection and control regime evaluation. | Bit array | - | Yes | No | bit(672) | Exactly 672 bits; at least 1 bit must be set | - | 0000000…1111111… (Mo 00:00–Mo 24:00 = bits 0–95) |
| note | Optional free-text note explaining the schedule (e.g. "Summer regime — reduced hours July–August"). Non-binding; for human orientation only. | String | null | No | No | - | Max 500 characters | - | School year regime — Mon–Fri 06:00–20:00 |
| 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, though the standard audit quintet includes it. 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, slots, note.
Excluded: none.
Not registered for entityName resolution, and has no independent human-readable attribute to register — identified by its buildingId/validFrom pair.