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

Description

Coordinates business logic for creating, editing, and retrieving relative contact records. Enforces relationship rules, applies role-based access checks, and bridges the Relative Form with the offline-first persistence layer.

Feature: Relative Contact Registration

relative-service

Sources & reasoning

Source explicitly designates Pårørende-database as Fase 1 MUST for Barnekreftforeningen (line 332 and matrix line 111). Registration of relatives as distinct contact subjects is the foundational capability that all downstream relative features depend on, so it must ship in MVP.

  • 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 (foreldre, søsken, nærmeste omsorgsperson) som egne kontaktsubjekter knyttet til samme
  • PĂĄrørende database | âś“ | - | - | - | âś“ | MUST (Barnekreft) | 1

Responsibilities

  • Create, update, and fetch relative records as first-class entities
  • Enforce role-based permissions for peer mentors and coordinators
  • Normalize and validate relationship metadata before persistence
  • Provide search and lookup operations for referencing relatives across features
  • Coordinate offline queuing and conflict resolution with the Relative Store

Interfaces

createRelative(payload): Promise<RelativeRecord>
updateRelative(relativeId, payload): Promise<RelativeRecord>
getRelative(relativeId): Promise<RelativeRecord>
searchRelatives(query): Promise<RelativeRecord[]>