Infrastructure low complexity Shared Component mobile
2
Dependencies
0
Dependents
0
Entities
0
Integrations

Description

Defines the Riverpod provider graph for the terminology system: the root organizationLabelsProvider, derived providers for individual label groups, and a labelProvider(key) family provider for granular widget rebuilds. Scoped to the authenticated user's organization to prevent cross-organization data leakage.

Feature: Dynamic Terminology & Labels System

terminology-riverpod-providers

Summaries

The Terminology Riverpod Providers form the reactive backbone that delivers each organization's custom vocabulary to every part of the mobile application in real time. For a platform serving multiple organizations — each with distinct role names, action labels, and domain language — this component is the mechanism that makes true multi-tenancy work at the user interface level. When an administrator updates terminology in the backend, the change propagates immediately to connected devices without requiring an app restart or manual refresh. This real-time, organization-scoped label delivery protects data isolation between tenants, reduces the risk of showing one organization's terminology to another's users, and directly supports the premium customization capability that differentiates the platform in competitive evaluations.

This component sits at the center of the terminology dependency graph and has direct upstream dependencies on the OrganizationLabelsNotifier and the TerminologySyncService, both of which must be stable before this provider layer can be fully tested end-to-end. Complexity is rated low, but the scoping requirement — providers must be tied to the authenticated user's active organization and properly disposed on logout — introduces a moderate integration testing burden. Plan for a dedicated QA pass on the logout-and-switch-organization scenario to confirm no stale terminology leaks across sessions. The `overrideWithTestMap` interface is a significant testing affordance that reduces test setup time across all terminology-dependent widgets, so ensure this is documented and adopted by the wider team early.

This module defines the full Riverpod provider graph for the terminology subsystem. The root `organizationLabelsNotifierProvider` exposes an `AsyncNotifier` scoped to the authenticated org, feeding derived providers. The `labelProvider(String key)` family provider is the primary consumption pattern for widgets — each widget subscribes only to the specific key it needs, ensuring granular rebuilds rather than full-tree invalidation on any label change. `fullTerminologyMapProvider` is available for bulk operations like validation or export.

Provider disposal on logout is enforced via the notifier's `dispose` lifecycle. In tests, inject `overrideWithTestMap(map)` via `ProviderScope` overrides to avoid any network dependency. Downstream consumers should always prefer the family provider over the full map provider to avoid unnecessary widget rebuilds.

Responsibilities

  • Declare the organizationLabelsNotifierProvider scoped to the active organization
  • Expose a labelProvider(key) family for per-key reactive subscriptions
  • Override providers in tests with mock terminology maps
  • Ensure providers are disposed when the user logs out

Interfaces

organizationLabelsNotifierProvider
labelProvider(String key)
fullTerminologyMapProvider
terminologySyncServiceProvider
overrideWithTestMap(map)

Relationships

Dependencies (2)

Components this component depends on

API Contract

View full contract →
REST /api/v1/terminology-providers 5 endpoints
GET /api/v1/terminology-providers
GET /api/v1/terminology-providers/:provider_id
POST /api/v1/terminology-providers
PUT /api/v1/terminology-providers/:provider_id
DELETE /api/v1/terminology-providers/:provider_id