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

Description

Business logic layer that orchestrates caregiver record creation, retrieval, update, and deletion. Enforces consent rules and links caregivers to their parent contact and case.

Feature: Caregiver & Next-of-Kin

caregiver-service

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

  • Create, update, and delete caregiver records tied to a parent contact
  • Validate relationship type and consent status against business rules
  • Fetch caregivers by parent contact for display in the contact detail view
  • Coordinate persistence through the Caregiver Store
  • Emit domain events when caregiver consent status changes

Interfaces

createCaregiver(parentContactId, data): Promise<Caregiver>
updateCaregiver(caregiverId, data): Promise<Caregiver>
deleteCaregiver(caregiverId): Promise<void>
listCaregiversForContact(parentContactId): Promise<Caregiver[]>
getCaregiver(caregiverId): Promise<Caregiver>