Data Layer medium complexity backend
0
Dependencies
0
Dependents
0
Entities
0
Integrations

Description

Persistence layer responsible for storing caregiver and next-of-kin records and their relationships to parent contacts. Provides query access by caregiver id and by parent contact id.

Feature: Caregiver & Next-of-Kin

caregiver-store

Sources & reasoning

Blueprint lists Caregiver & Next-of-Kin under the Contacts area as a distinct feature. It is the per-contact carer attachment (distinct from the Relatives Database area). Not in mobile MVP screens list, so target_release defaults to Core Product per resolution rule 3.

  • PĂĄrørende-database: 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
  • contacts | Contacts | Contact List & Search, Contact Detail & Edit, Caregiver & Next-of-Kin
  • PĂĄrørende database | âś“ | - | - | - | âś“ | MUST (Barnekreft) | 1

Responsibilities

  • Persist caregiver records with relationship and consent fields
  • Maintain foreign key linkage to parent contact and case
  • Query caregivers by parent contact id
  • Support soft-delete or hard-delete per data retention policy
  • Enforce unique constraints to prevent duplicate caregiver entries per contact

Interfaces

insert(caregiver): Promise<Caregiver>
update(caregiverId, fields): Promise<Caregiver>
delete(caregiverId): Promise<void>
findById(caregiverId): Promise<Caregiver | null>
findByParentContact(parentContactId): Promise<Caregiver[]>