Appearance
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 Name | Description | Data Type | Default Value | Required (= Nullable) | Unique | Format | Validations | Index | Example |
|---|---|---|---|---|---|---|---|---|---|
| id | Primary key of the entity. | UUID | uuidv7() — DB default | Yes | Yes | UUID v7 | - | Primary Key | 018fa51f-fda1-79f4-8461-2cb8f1cabc10 |
| tenantId | Tenant this record belongs to. Set explicitly by the inserting adapter — unlike most other tables, this column carries no DB-level default. | UUID | - | Yes | No | UUID v7 | Foreign Key → tenant; must exist | - | 018fa51f-fda3-7c63-b5a9-3fa33dc989de |
| createdAt | Timestamp of entity creation. Immutable. | Timestamp with time zone | now() | Yes | No | ISO 8601 — YYYY-MM-DDTHH:mm:ss.SSSZ | - | - | 2026-03-01T09:00:00Z |
| updatedAt | Timestamp of last update. In practice never meaningfully updated — no update path exists on this entity. | Timestamp with time zone | now() | Yes | No | ISO 8601 — YYYY-MM-DDTHH:mm:ss.SSSZ | - | - | 2026-03-01T09:00:00Z |
| createdBy | Actor who created this record. | String | - | Yes | No | type:actor | - | - | user:018ed0b3-c298-7c7a-96d5-8b36f5a7f8d2 |
| updatedBy | Present for schema consistency; equals createdBy in practice, since no update path exists. | String | - | Yes | No | type:actor | - | - | user:018ed0b3-c298-7c7a-96d5-8b36f5a7f8d2 |
| deletedAt | Schema-present but unused — no code path ever sets it (PhysicalMeterRepositoryPort exposes insert only, no update or delete method). | Timestamp with time zone, nullable | null | No | No | ISO 8601 — YYYY-MM-DDTHH:mm:ss.SSSZ | Never 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).