OrganizationLabelsRepository
Component Detail
Data Layer
medium complexity
backend
0
Dependencies
0
Dependents
0
Entities
0
Integrations
Description
Data access layer responsible for reading and writing per-organization label override records in the database. Provides CRUD operations scoped to an organization and supports bulk retrieval for cache warming and mobile offline sync payloads.
organization-labels-repository
Sources & reasoning
Directly described in the Mobile App Architecture section (line 305-307) as a built-in capability, and grouped with organization settings in the MVP admin scope (line 325). Multiple organizations explicitly use different terminology for the same concepts, making this a launch-critical capability rather than a deferred enhancement.
-
docs/source/likeperson.md · line 305-307Organization labels system - per-org terminology overrides fetched from backend and cached offline (currently: `contacts`, `my_contacts`, `peer_mentors`; extensible to singular forms and role terms
-
docs/source/likeperson.md · line 325Organisasjonsinnstillinger og terminologikonfigurasjon
Responsibilities
- Read all label overrides for a given organization
- Insert or update a single label override keyed by org ID and terminology key
- Delete a label override to restore the platform default for that key
- Bulk-read all overrides for an org to support offline cache export for mobile
- Track updated_at timestamps per override for version-based sync checks
Interfaces
findByOrg(orgId: string): Promise<LabelOverride[]>
upsert(orgId: string, key: string, value: string): Promise<LabelOverride>
delete(orgId: string, key: string): Promise<void>
findUpdatedSince(orgId: string, since: Date): Promise<LabelOverride[]>