Appearance
Entity: climateNormal
Entity: climateNormal
Description: Stores the long-term climate normal for a weather station — a set of 12 rows (one per calendar month) representing long-term reference averages of heating days and average temperature (period length and data source are not modelled or validated by the system). The normal is mutable: rows can be updated by a superadmin (for global stations) or by the client admin (for tenant-owned stations). Used together with climateData in the degree-day normalisation ratio calculation to produce normalised energy consumption figures. Additional reference parameters, if available, are stored in extraParameters.
Entity Type: database table
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 in code (app layer) | Yes | Yes | UUID v7 | - | Primary Key | 018ed0b3-c298-7c7a-96d5-8b36f5a7f8d2 |
tenantId | Tenant this record belongs to. Mirrors the tenantId of the parent weather station. null for global ČHMÚ station normals. | UUID | - | No | No | UUID v7 or null | Foreign Key: tenant (when non-null); must exist | name: idx_climateNormal_tenantId, type: btree | 018fa51f-fda1-79f4-8461-2cb8f1cabc10 |
weatherStationId | The weather station this normal row belongs to. | UUID | - | Yes | No | UUID v7 | Foreign Key: weatherStation; must exist. Composite unique constraint: (weatherStationId, month) | name: idx_climateNormal_weatherStationId, type: btree | 018ed0b3-c298-7c7a-96d5-8b36f5a7f8d2 |
month | Calendar month this normal row represents. Each station has exactly 12 rows, one per month. | integer | - | Yes | No | 1–12 | Range 1–12. Composite unique constraint: (weatherStationId, month) | - | 1 |
heatingDays | 30-year average number of heating days for this month. Used in the normalisation formula. | decimal | - | No | No | Two decimal places | ≥ 0 | - | 21.30 |
avgTemp | 30-year average outdoor temperature for this month in °C. Used in the normalisation formula. | decimal | - | No | No | °C, two decimal places | - | - | -1.80 |
extraParameters | Additional optional long-term reference values beyond heatingDays/avgTemp, if a reference average is available for them. Free-form — keys and units are not enumerated or validated. | JSONB | null | No | No | JSON — free-form, no fixed shape (see note below) | - | - | {"precipitation": 45.0, "sunshineHours": 62.5} |
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 to the record. Set on insert and updated on every change. | 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 the record is 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 — e.g. user:uuid or system:migration | Non-empty | - | user:018ed0b3-c298-7c7a-96d5-8b36f5a7f8d2 |
updatedBy | Identifier of the actor who last updated the record. | string | - | Yes | No | type:actor — e.g. user:uuid or system:migration | Non-empty | - | system:migration-v25 |
Note —
extraParametersJSON shape not documented. As withclimateData.extraParameters, the source page describes this JSONB column as free-form with no enumerated keys/units. No sibling JSON-DAT was created; flagging for review (see the equivalent note on climateData).
Audited fields
Recorded on created (in full), updated (changed only) and deleted (in full) — unlike climateData, this entity is documented as mutable (superadmin or client admin can revise a normal directly): weatherStationId, month, heatingDays, avgTemp, extraParameters.
Excluded: none.
Every entry would carry subjectEntityType = weatherStation / subjectEntityId = weatherStationId — one row per calendar month, twelve per station, month on the entry disambiguates which.
Not registered for entityName resolution, and has no independent human-readable attribute to register — identified by its weatherStationId/month pair.