Organization Label
Data Entity
Description
A key-value terminology override that allows each organization to customize the language used throughout the app. Since NHF, Blindeforbundet, HLF, and Barnekreftforeningen use different terms for the same concepts (e.g., 'peer mentor' vs 'likeperson'), this entity enables dynamic terminology per organization.
Data Structure
| Name | Type | Description | Constraints |
|---|---|---|---|
id |
uuid |
Unique identifier for this label override record | PKrequiredunique |
organization_id |
uuid |
Foreign key reference to the owning organization. All label overrides are scoped to one organization. | required |
label_key |
string |
The stable system-defined key identifying which UI string this record overrides (e.g., 'peer_mentor', 'coordinator', 'activity', 'contact'). Keys are defined by the platform and must exist in the canonical key registry. | required |
label_value |
string |
The organization-specific display string that replaces the system default for this key (e.g., 'Likeperson' instead of 'Peer Mentor', 'Rådgiver' instead of 'Coordinator'). | required |
category |
enum |
Grouping category for the label key, used for UI filtering and organized display in the Terminology Editor Screen. | required |
default_value |
string |
The platform-wide system default string for this key before any org override is applied. Stored here for display in the editor so admins can compare their override against the default. | required |
description |
text |
Human-readable explanation of where and how this label key is used in the app, to guide Organization Administrators when editing terminology. | - |
updated_at |
datetime |
Timestamp of the last modification to this label record. Used for cache invalidation and audit purposes. | required |
created_at |
datetime |
Timestamp when this label override was first created. | required |
updated_by |
uuid |
Foreign key to the user (Organization Administrator or Global Administrator) who last modified this label override. Used for audit trail. | - |
Database Indexes
idx_organization_label_org_key
Columns: organization_id, label_key
idx_organization_label_org_id
Columns: organization_id
idx_organization_label_category
Columns: organization_id, category
idx_organization_label_updated_at
Columns: organization_id, updated_at
Validation Rules
label_key_in_canonical_registry
error
Validation failed
label_value_non_empty
error
Validation failed
label_value_max_length
error
Validation failed
organization_id_exists
error
Validation failed
category_valid_enum
error
Validation failed
label_key_snake_case_format
error
Validation failed
no_html_in_label_value
error
Validation failed
Business Rules
unique_key_per_organization
Each label_key must be unique within an organization. An organization can have at most one override per key. Attempting to create a duplicate (organization_id, label_key) pair must trigger an upsert rather than insert.
fallback_to_system_default
If no organization_label record exists for a given (organization_id, label_key) pair, consuming components must fall back to the platform-defined system default. No label key may ever render as empty or null in the UI.
admin_only_write_access
Only users with Organization Administrator or Global Administrator roles may create, update, or delete label overrides. Coordinators and Peer Mentors are restricted to read-only access via the cache.
cache_invalidation_on_change
Any write operation (create, update, delete) on an organization_label record must invalidate the in-memory and persisted label cache for the affected organization_id. The cache must be refreshed before the next UI render cycle.
cache_invalidation_on_org_switch
When a user switches their active organization context, the label cache must be invalidated and reloaded for the new organization_id to prevent terminology bleed between tenants.
org_scope_isolation
Label queries must always be scoped to a single organization_id. Cross-organization label reads are forbidden. The multi-tenancy infrastructure must enforce this at the middleware layer for all API calls.
reset_to_default_preserves_key
When an admin resets a label to its system default, the label record may be deleted (allowing fallback logic to serve the default) rather than storing a copy of the default value. This prevents stale default copies if system defaults are updated.
bufdir_field_mapping_uses_labels
Bufdir report field mapping must apply organization-specific label overrides when generating report field headers and category labels, so that exported reports reflect the terminology each organization uses internally.
CRUD Operations
Storage Configuration
Entity Relationships
An organization owns a set of terminology overrides customizing app labels throughout the platform