RelativeRoleService
Component Detail
Description
Backend service that manages the assignment and retrieval of role tags on relative-case links. It enforces that only valid predefined role values are accepted and that the tag is stored per-link rather than per-relative, so the same person can hold different roles across cases. It exposes endpoints consumed by the widget and by the case view to read and update role assignments.
relative-role-service
Sources & reasoning
The enumeration of specific relative types (foreldre, søsken, nærmeste omsorgsperson) in line 121 implies that the system must distinguish between different family roles - storing them as typed tags rather than anonymous entries. Phase 1 MUST confirmed on line 161. Role tagging is the feature that makes the relative type explicit and filterable, completing the family-unit data model required by Barnekreftforeningen's workflow.
-
docs/source/likeperson.md · line 121-122Appen 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 161Pårørende database | ✓ | - | - | - | ✓ | MUST (Barnekreft) | 1
Responsibilities
- Validate that a submitted role value exists in the canonical predefined role vocabulary
- Persist the role tag against the specific relative-case link record
- Retrieve the current role tag for a given link ID for display purposes
- Return the full list of available role tag options for widget population
- Enforce that only coordinators and peer mentors are authorized to modify role tags
Interfaces
getRoleTags(): RoleTag[]
getRoleForLink(linkId: string): RoleTag
setRoleForLink(linkId: string, role: RoleTag, actorId: string): void
validateRole(role: string): boolean