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.

Feature: Caregiver & Next-of-Kin

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.

  • Barnekreftforeningen 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.
  • PĂĄrørende database | âś“ | - | - | - | âś“ | MUST (Barnekreft) | 1
  • PĂĄ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>>