CaregiverService
Component Detail
Service Layer
medium complexity
mobile
0
Dependencies
0
Dependents
1
Entities
0
Integrations
Description
Orchestrates caregiver CRUD operations, enforcing role-based access rules before delegating reads and writes to CaregiverRepository. Enqueues mutations to the outbox for backend sync when connectivity is available. Resolves Organization Label configuration for the active tenant.
caregiver-service
Sources & reasoning
Lines 121, 161, and 438 form a clear provenance chain: the requirement is stated (121), marked MUST in Phase 1 (161), and explicitly restated as Phase 1 MUST (438). Blueprint places this in Contacts (not Relatives Database) because it concerns caregivers linked to existing contacts, not a standalone relatives registry. Phase 1 = MVP by ordinal mapping.
-
docs/source/likeperson.md · line 121Barnekreftforeningen jobber primært med familier rundt barn med kreft, ikke kun med de berørte selv. Appen må støtte registrering av pårørende (foreldre, søsken, nærmeste omsorgsperson) som egne kontaktsubjekter knyttet til samme sak.
-
docs/source/likeperson.md · line 161Pårørende database | ✓ | - | - | - | ✓ | MUST (Barnekreft) | 1
-
docs/source/likeperson.md · line 438Pårørende-database er Fase 1 MUST for Barnekreftforeningen
Responsibilities
- Enforce role-based access control before allowing add, edit, or delete operations
- Delegate caregiver reads and writes to CaregiverRepository
- Enqueue outbox mutations for backend synchronisation on create, update, and delete
- Resolve active tenant's Organization Label for caregiver terminology
- Propagate validation errors and conflict signals back to the UI layer
Interfaces
getCaregivers(contactId: string): Promise<Caregiver[]>
addCaregiver(contactId: string, data: CaregiverInput, role: Role): Promise<Caregiver>
updateCaregiver(caregiverId: string, data: CaregiverInput, role: Role): Promise<Caregiver>
deleteCaregiver(caregiverId: string, role: Role): Promise<void>
getOrganizationLabel(tenantId: string): CaregiverLabelConfig