Skip to content
Updated Sep 26, 2026 by Barča Dvořáková · Owner: analysisactiveentity Edit on GitHub

Entity: defaultCalorificValue ​

Entity Type: Database table (shared schema)

Description: The platform's default calorific value for a medium and primary source — the factor that converts a volume or a mass of fuel into energy when nobody closer to the gauge has stated a better one. Values come from national standards and change rarely, but they do change, so each one carries the date it starts applying and none is ever overwritten.

This is the outermost of the three scopes a calorific value can be stated at. It carries the same columns as the tenant-side calorificValue, so the resolver compares like with like; the two are separate tables only because cross-tenant data may live only in the shared schema while a per-gauge value cannot.

Data Attributes Table ​

Attribute NameDescriptionData TypeDefault ValueRequired (= Nullable)UniqueFormatValidationsIndexExample
idPrimary key of the entity.UUIDGenerated in code (app layer)YesYesUUID v7-Primary Key018f9c4d-2c11-7a3e-9b77-4f0d3a5e6b41
tenantIdAlways null for a platform default, which is what makes the row readable by every tenant. Present because the shared-schema policies read it.UUIDnullNoNoUUID v7Must be null on a row created through the platform administration surface.name: idx_default_calorific_value_tenant_id, type: btreenull
mediumMedium the value applies to.Enum-YesPart of composite uniqueEnum - GaugeMediumAn entry from the enum. Only media that convert to energy carry rows.name: uq_default_calorific_value_scope, type: btree (unique, partial)gas
primarySourceFuel or source the value applies to within the medium — natural gas and biogas convert differently.Integer-YesPart of composite uniqueEnum - PrimarySourceAn entry from the enum.Part of the unique index above1
valueThe conversion factor itself: how much energy one unit of unitFrom yields, expressed in unitTo.Decimal-YesNonumeric(12,6)Must be > 0.-10.550000
unitFromUnit the factor converts from.Enum-YesNoEnum - UnitMust be a volume or mass unit.-m³
unitToUnit the factor converts to.Enum-YesNoEnum - UnitMust be an energy unit.-kWh
validFromFirst day the value applies. A value has no explicit end: it runs until the next value for the same medium and primary source begins.Date-YesPart of composite uniqueYYYY-MM-DDUnique per (medium, primarySource, validFrom) among rows where deletedAt is null.Part of the unique index above2024-01-01
noteWhere the value comes from — the standard, table or measurement it was taken from.StringnullNoNo-Max 500 characters.-ČSN 38 5502, tabulka 3
createdAtTimestamp of record creation.Timestamp with time zonenow() — set in codeYesNoISO 8601 — YYYY-MM-DDTHH:mm:ss.SSSZCannot be null.-2023-12-18T10:00:00Z
updatedAtTimestamp of the last update.Timestamp with time zonenow() — set in codeYesNoISO 8601 — YYYY-MM-DDTHH:mm:ss.SSSZCannot be null.-2023-12-18T10:00:00Z
deletedAtSoft-delete marker for a row entered in error. Null means active. A superseded value is never deleted — it is what reproduces consumption from the period it covered.Timestamp with time zonenullNoNoISO 8601 — YYYY-MM-DDTHH:mm:ss.SSSZImmutable once set. Active rows: WHERE deletedAt IS NULL.-null
createdByActor who created the record.String-YesNotype:actorNon-empty.-user:018ed0b3-…
updatedByActor who last updated the record.String-YesNotype:actorNon-empty.-user:018ed0b3-…

Indexes ​

NameColumnsTypeWhy
uq_default_calorific_value_scopemedium, primarySource, validFrom where deletedAt is nullUnique, partialOne default per medium, source and start date; a withdrawn row must not block re-entering the same date.
idx_default_calorific_value_tenant_idtenantIdbtreeSupports the shared-schema policies.

Row-level security ​

Enabled and forced, with the split read and write policies the shared schema uses: readable when tenantId is null or matches the current tenant, writable only in a context with no tenant set — the platform administration context. A tenant reads every default and changes none.

Audited fields ​

Recorded on created (in full), updated (changed only) and deleted (in full): medium, primarySource, value, unitFrom, unitTo, validFrom, note.

Excluded: tenantId — always null on a platform row, so it carries no information about the change.

Not registered for entityName resolution, and has no independent human-readable attribute to register — identified by its medium/primarySource/validFrom scope.