CaregiverRepository
Component Detail
Data Layer
medium complexity
mobile
0
Dependencies
0
Dependents
0
Entities
0
Integrations
Description
Persists and retrieves caregiver records in the local Drift SQLCipher-encrypted database for full offline access. Handles insert, update, delete, and query operations scoped to a contact ID. Surfaces pending outbox records for the sync layer to consume.
caregiver-repository
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
- Store caregiver records in the encrypted local Drift database keyed by contact ID
- Retrieve all caregivers for a given contact with a single query
- Apply insert, update, and hard-delete operations within database transactions
- Write mutation events to the outbox table for backend sync
- Expose pending outbox entries for the sync service to process
Interfaces
findByContactId(contactId: String): Future<List<Caregiver>>
insert(caregiver: Caregiver): Future<void>
update(caregiver: Caregiver): Future<void>
delete(caregiverId: String): Future<void>
getPendingOutboxEntries(): Future<List<OutboxEntry>>