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

Entity: physicalMeter ​

Entity Type: Database table

Description: A backend-only grouping record for one physical metering device. It carries no descriptive business columns of its own — every attribute of the physical device (serial number, manufacturer, phase count, circuit breaker, distributor tariff, etc.) lives on gauge itself. Several gauge rows that share one installed device (e.g. import/export channels, or multiple phases) reference one common physicalMeter.id via gauge.physicalMeterId; physical_meter holds no reference back to gauge. Never exposed via its own API — there is no controller, no DTO, no screen for it. The only row ever created is minted as a side effect of gauge creation's "channel" flow (CreateGaugeUseCase.resolveChannelPhysicalMeter), exactly once per physical device.

Data Attributes Table ​

Attribute NameDescriptionData TypeDefault ValueRequired (= Nullable)UniqueFormatValidationsIndexExample
idPrimary key of the entity.UUIDuuidv7() — DB defaultYesYesUUID v7-Primary Key018fa51f-fda1-79f4-8461-2cb8f1cabc10
tenantIdTenant this record belongs to. Set explicitly by the inserting adapter — unlike most other tables, this column carries no DB-level default.UUID-YesNoUUID v7Foreign Key → tenant; must exist-018fa51f-fda3-7c63-b5a9-3fa33dc989de
createdAtTimestamp of entity creation. Immutable.Timestamp with time zonenow()YesNoISO 8601 — YYYY-MM-DDTHH:mm:ss.SSSZ--2026-03-01T09:00:00Z
updatedAtTimestamp of last update. In practice never meaningfully updated — no update path exists on this entity.Timestamp with time zonenow()YesNoISO 8601 — YYYY-MM-DDTHH:mm:ss.SSSZ--2026-03-01T09:00:00Z
createdByActor who created this record.String-YesNotype:actor--user:018ed0b3-c298-7c7a-96d5-8b36f5a7f8d2
updatedByPresent for schema consistency; equals createdBy in practice, since no update path exists.String-YesNotype:actor--user:018ed0b3-c298-7c7a-96d5-8b36f5a7f8d2
deletedAtSchema-present but unused — no code path ever sets it (PhysicalMeterRepositoryPort exposes insert only, no update or delete method).Timestamp with time zone, nullablenullNoNoISO 8601 — YYYY-MM-DDTHH:mm:ss.SSSZNever set by any current write path-null

Audited fields ​

Recorded on created only — no update or delete method exists on PhysicalMeterRepositoryPort, so updated/deleted entries never occur: id, tenantId, createdAt, updatedAt, createdBy, updatedBy, deletedAt — all 7 columns on the row, since this entity has no business columns of its own. A created entry answers only "was a device identity minted, by whom, when" — the correct result of the mechanism applied to an entity with nothing else to show, not a workaround failure.

Excluded: none.

physicalMeter self-subjects (subjectEntityType = physicalMeter, subjectEntityId = physicalMeter.id) — declared for consistency, though nothing files against it as parent today. Not registered for entityName resolution, and has no independent human-readable attribute to register (architecture 61-audit-log.md §7.4 in the code repo: an unregistered type renders id-only — a valid, permanent state, not a gap).