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

Description

Manages the join-table records that bind relative contacts to primary case contacts. It exposes CRUD operations for creating, retrieving, and removing bidirectional case links and enforces that both the relative and the primary case contact exist before a link is persisted. Returns structured link data consumed by the widget and the contact/relative detail screens.

Feature: Relative Case Linking

relative-case-link-service

Sources & reasoning

The phrase 'knyttet til samme sak' (linked to the same case) in line 121 directly specifies that relatives must be associated with a primary case contact, not just registered in isolation. Phase 1/MVP placement is confirmed by the priority matrix (line 161). Case linking is also a structural prerequisite for relative-role-tagging, which applies tags to link records.

  • 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

Responsibilities

  • Create a link record in the join table between a relative ID and a primary case contact ID
  • Retrieve all relatives linked to a given case contact
  • Retrieve the primary case contact linked to a given relative
  • Delete a link when a relative is disassociated from a case
  • Validate that referenced relative and case contact IDs exist before persisting a link

Interfaces

linkRelativeToCase(relativeId: string, caseContactId: string): CaseLink
getRelativesByCase(caseContactId: string): Relative[]
getPrimaryCaseForRelative(relativeId: string): CaseContact
unlinkRelativeFromCase(relativeId: string, caseContactId: string): void

Related Data Entities (1)

Data entities managed by this component