Appearance
Entity: gaugePurposeOption
Entity Type: Database table
Description: The selectable "word choice" a user picks when creating a gauge, after choosing kind and medium. Each row represents one wording (via translationKey) and the resulting technical configuration (direction, outputMode, purposeCategory) it maps to. This is the mechanism that lets a superadmin offer multiple wordings for an identical underlying configuration without any deployment — e.g. "Odebráno ze sítě" and "Odebráno" can both be separate rows pointing to the same (direction, outputMode, purposeCategory) target. gauge.purpose stores a reference to the specific row the user picked (not just the resulting combination), so the original selection is reconstructable later even when several options share the same target.
Adding a new wording variant that targets an existing, valid combination is a superadmin, no-deployment operation (new row here + a corresponding uiLabel entry). Adding an entirely new combination — a direction/outputMode pairing that isn't already valid — still requires developer involvement, since it is tied to enum values and buildingTotal formula logic (see Gauge Management → Functional Requirements → outputMode and buildingTotal).
Data Attributes Table
| Attribute Name | Description | Data Type | Default Value | Required (= Nullable) | Unique | Format | Validations | Index | Example |
|---|---|---|---|---|---|---|---|---|---|
| id | Unique identifier for the option. This is the value referenced by gauge.purpose. | UUID | Generated in code (app layer) | Yes | Yes | UUID v7 | Must be a valid UUID v7. | Primary Key | 01960000-0000-7000-8000-000000000040 |
| kind | Which gauge kind this option is offered for. | String | - | Yes | No | enum | Must be one of standard, subGauge. Virtual gauges do not use this mechanism (created via formula editor). | - | standard |
| medium | Which medium this option is offered for. | String | - | Yes | No | enum | Must be one of the defined enum values. | - | electricity |
| translationKey | Reference to the uiLabel entry providing the displayed wording for this option, in every supported locale. | String | - | Yes | Yes | Dot notation, e.g. gauge.purposeOption.consumedFromGrid | Must match an existing uiLabel.translationKey. | - | gauge.purposeOption.consumedFromGrid |
| targetDirection | The direction value applied to the gauge when this option is selected. | String | null | No | No | enum | Null only when medium = kvp. | - | import |
| targetOutputMode | The outputMode value applied to the gauge when this option is selected. | String | null | No | No | enum | Null only when medium = kvp. | - | include |
| purposeCategory | The business-meaning category this option belongs to. Several options (different wordings) may share the same category and the same target combination — that is the expected, supported case. | String | null | No | No | enum | - | - | consumedFromGrid |
| sortOrder | Display order of this option within the filtered (kind, medium) list. | Integer | 0 | Yes | No | - | - | - | 10 |
| isActive | Whether this option is currently offered to users. Deactivating an option (instead of deleting it) preserves referential integrity for gauges that already reference it via purpose. | Boolean | true | Yes | No | - | - | - | true |
| isDefaultForCombination | Marks this option as the canonical choice for its (kind, medium, targetDirection, targetOutputMode) combination — used by the EM2 migration script to back-fill purpose for migrated gauges, where no user ever made an explicit wording choice. At most one active option should be flagged per combination. | Boolean | false | Yes | No | - | Application-layer check recommended: at most one isActive = true row with isDefaultForCombination = true per (kind, medium, targetDirection, targetOutputMode). | - | true |
| createdAt | Timestamp of creation. Immutable. | Timestamp with time zone | Set in code | Yes | No | ISO 8601 | - | - | 2026-07-17T10:00:00Z |
| updatedAt | Timestamp of last update. | Timestamp with time zone | Set in code | Yes | No | ISO 8601 | - | - | 2026-07-17T10:00:00Z |
| createdBy | Actor who created this record. | String | - | Yes | No | type:actor | - | - | user:01960000-0000-7000-8000-000000000099 |
| updatedBy | Actor who last updated this record. | String | - | Yes | No | type:actor | - | - | user:01960000-0000-7000-8000-000000000099 |
References
- gauge
.purpose— foreign key to this entity - uiLabel — provides the display text via
translationKey - Gauge creation flow (feature page)
Discrepancy flagged during migration. This entity's source page has no tenantId and no deletedAt column at all — unlike every other reviewed entity, tenant scoping and soft-delete are entirely absent here. The page gives no explicit rationale (unlike uiLabel, which documents its tenantless design as a deliberate exception). This entity reads as a global/shared configuration table, similar in spirit to uiLabel, but the exception is not stated as such on the page — worth confirming with the author whether this is intentional.
Audited fields
Recorded on created (in full) and updated (changed only) — this entity's own Data Attributes Table has no deletedAt at all (a discrepancy flagged on the page itself), so deactivation is expressed as an updated entry on isActive, never a deleted one: kind, medium, translationKey, targetDirection, targetOutputMode, purposeCategory, sortOrder, isActive, isDefaultForCombination.
Excluded: none.
No subjectEntityType/subjectEntityId and no tenantId — global, superadmin-managed configuration, same exception class as uiLabel and the contract-catalog entities. Not registered for entityName resolution (architecture 61-audit-log.md §7.4/§7.6 in the code repo: a valid, permanent state, not a gap). If registered, translationKey is the natural candidate.