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

Entity: gaugeSourceSetting ​

Entity Type: Database table

Description: Reading settings of one channel for one reading source. A channel (gauge record) read both ways has two settings — a manual one and a remote one — because the same parameter often arrives in a different unit and at a different interval from each source: gas read by hand in m³ monthly but delivered by the connector as pulses every hour, heat read as GJ but delivered in MWh. The settings therefore carry their own unit, reading frequency and coefficient instead of the gauge carrying one of each. Records follow the versioned / append-only pattern of gaugeSerialHistory: a change writes a new record with a new validFrom, the previous one is kept so historical consumption keeps being computed with the values that applied then, and a new record triggers recalculation of the affected consumption records from its validFrom. The remote record is pre-filled from the paired remoteEndPoint and is not editable by the user. Decided 22 September 2026; replaces the single unit and coefficient held on the gauge.

Data Attributes Table ​

Attribute NameDescriptionData TypeDefault ValueRequired (= Nullable)UniqueFormatValidationsIndexExample
idPrimary key of the entity.UUIDGenerated in code (app layer)YesYesUUID v7-Primary Key01960000-0000-7000-8000-000000000201
tenantIdTenant that owns this record. Denormalised from gauge for uniform data-scoping.UUID-YesNoUUID v7Foreign Key → tenant; must equal the parent gauge.tenantId.name: idx_gaugeSourceSetting_tenantId, type: btree01960000-0000-7000-8000-000000000099
gaugeIdThe channel these settings apply to.UUID-YesNoUUID v7Foreign Key → gauge; must exist.name: idx_gaugeSourceSetting_gaugeId_source_validFrom, type: btree (composite, validFrom DESC)01960000-0000-7000-8000-000000000005
sourceReading source these settings belong to. A channel has at most one active record per source.String-YesNoenum — ReadingSourceValues: manual, remote. invoice is not a configurable source here. Must be consistent with gauge.readingMethod.-manual
unitUnit in which readings arrive from this source, before the coefficient is applied. May differ from gauge.unit, which stays the canonical unit consumption is stored in.String-YesNoenum — UnitMust be convertible to gauge.unit using coefficient.-imp
readingFrequencyHow often a reading is expected from this source. Drives the manual reading-frequency check and the staleness check on remote feeds.String-YesNoenum — GaugeBillingFrequency or interval codeManual: daily to yearly. Remote: taken from the endpoint (15 min, hourly, daily).-monthly
coefficientMultiplier applied to a raw value from this source to get the quantity in gauge.unit — pulse weight, transformer ratio or a correction of the installation. Versioned together with the rest of the record.Decimal1.0YesNoDecimal(18,6)Greater than zero.-0.010000
frequencyCheckEnabledWhether a missing reading from this source raises a notice. Defaults to true for manual sources on gauges that are read by hand or both ways.BooleantrueYesNo---true
remoteEndPointIdThe paired connector endpoint this remote setting was pre-filled from. Null for manual settings.UUIDnullNoNoUUID v7Foreign Key → remoteEndPoint; required when source = remote.name: idx_gaugeSourceSetting_remoteEndPointId, type: btree01960000-0000-7000-8000-000000000301
validFromTimestamp from which these settings apply. A change writes a new record instead of updating this one.Timestamp with time zone-YesNoISO 8601Unique per gaugeId + source.name: idx_gaugeSourceSetting_gaugeId_source_validFrom, type: btree (composite)2026-09-22T08:00:00Z
createdAtTimestamp of entity creation. Immutable.Timestamp with time zoneSet in codeYesNoISO 8601--2026-09-22T08:00:00Z
createdByIdentifier of the actor who created this record.String-YesNotype:actor--user:01960000-0000-7000-8000-000000000099

Audited fields ​

Recorded on created (in full) only — this table has no updatedAt/updatedBy columns and no deletedAt; a change is a new versioned record (new validFrom), never an update to an existing one: gaugeId, source, unit, readingFrequency, coefficient, frequencyCheckEnabled, remoteEndPointId, validFrom.

Excluded: none.

Every entry carries subjectEntityType = gauge / subjectEntityId = gaugeId — this table has no identity of its own beyond the gauge it belongs to.

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

Notes ​

  • Migration: the unit and coefficient held on the gauge today move into a manual record with validFrom = migration date; gaugeCoefficient history maps onto the coefficient of the matching source.
  • A channel with gauge.readingMethod = both must have exactly one active record per source; the API rejects a save that leaves a source without settings.