Infrastructure low complexity Shared Component shared
0
Dependencies
0
Dependents
1
Entities
0
Integrations

Description

A compile-time constant registry of all label keys used across the application, defined as a Dart abstract class with static string constants. Prevents key typos at the call site, enables IDE autocompletion, and serves as a single source of truth for which keys must exist in every organization's terminology map.

Feature: Dynamic Terminology & Labels System

label-key-registry

Summaries

The Label Key Registry is the organizational language contract baked directly into the application, ensuring every customer-facing term your platform displays is always consistent, always intentional, and never accidentally misspelled at the code level. For a multi-tenant product serving diverse organizations with unique role names and vocabularies, terminology errors erode trust and increase support costs. By centralizing all label keys as compile-time constants, this component eliminates an entire category of runtime defects — wrong labels never ship because they cannot compile. This directly reduces QA cycles, prevents embarrassing terminology mismatches in demos or production, and allows onboarding new organizations faster with confidence that the terminology system is structurally sound.

The Label Key Registry is a low-complexity, zero-dependency shared component that should be scoped early in the project timeline as it is a foundational dependency for every other terminology-related component. Because it is an abstract Dart class with static constants and no runtime logic, implementation effort is minimal — typically a single sprint task. However, its early delivery is critical: any component touching user-visible labels (navigation, role display, activity types, report fields) must reference this registry, creating a scheduling dependency across the entire UI layer.

Plan a brief cross-team review when the key list is first drafted to ensure all product domains are represented, and schedule periodic registry audits when new features introduce new terminology requirements.

Label Key Registry is a pure compile-time artifact — a Dart abstract class with no instantiation, only static string constants organized by domain (roles, activity types, navigation, report fields). Consuming code references keys via `LabelKeys.roleCoordinator` or the parameterized helpers `LabelKeys.activityTypePrefix(type)` and `LabelKeys.navTab(tab)`. The `allRequired()` method returns the complete list used by validation logic to assert that every organization's terminology map covers all mandatory keys before it is committed. There are no external dependencies, making this safe to import anywhere including test harnesses.

When adding new UI text that varies by organization, the correct first step is always adding the constant here before wiring any provider or widget. IDE autocompletion via static references is the primary ergonomic payoff.

Responsibilities

  • Define all label key constants as static string fields
  • Group keys by domain (roles, activity types, navigation, report fields)
  • Provide a complete list of required keys for validation
  • Document the intended meaning of each key with inline comments

Interfaces

LabelKeys.roleCoordinator
LabelKeys.rolePeerMentor
LabelKeys.activityTypePrefix(type)
LabelKeys.reportField(field)
LabelKeys.navTab(tab)
LabelKeys.allRequired() → List<String>

Related Data Entities (1)

Data entities managed by this component

API Contract

View full contract →
REST /api/v1/label-key-registry 5 endpoints
GET /api/v1/label-key-registry
GET /api/v1/label-key-registry/:key
POST /api/v1/label-key-registry
PUT /api/v1/label-key-registry/:key
DELETE /api/v1/label-key-registry/:key