Case Link Service
Component Detail
Service Layer
medium complexity
backend
0
Dependencies
0
Dependents
0
Entities
0
Integrations
Description
Backend service that manages bidirectional relationships between primary contacts and their relatives. Enforces linking rules, supports many relatives per case, and exposes operations consumed by search, activity logging, and notes.
case-link-service
Sources & reasoning
Source line 77 explicitly states relatives must be linked 'til samme sak' (to the same case). Case linking is the structural mechanism that fulfills this requirement and is part of the Pårørende-database Fase 1 MUST scope per the matrix at line 111.
-
docs/source/likeperson.md · line 77Appen 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 111Pårørende database | ✓ | - | - | - | ✓ | MUST (Barnekreft) | 1
Responsibilities
- Create and remove bidirectional case-to-relative links
- Validate that both endpoints exist before persisting a link
- Resolve all relatives for a given case and the case for a given relative
- Prevent duplicate links between the same case and relative
- Coordinate persistence through the Relative Link Store
Interfaces
linkRelativeToCase(caseId, relativeId): CaseLink
unlinkRelative(linkId): void
getRelativesForCase(caseId): Relative[]
getCaseForRelative(relativeId): Case