AssignmentRepository
Component Detail
Data Layer
medium complexity
backend
0
Dependencies
0
Dependents
1
Entities
0
Integrations
Description
Provides persistent storage and retrieval of encrypted assignments, their status history, and receipt events. All sensitive fields are stored in encrypted form and the repository enforces access scoping so coordinators can only query their own assignments. Supports efficient status-based queries for the reminder scheduler.
assignment-repository
Sources & reasoning
Lines 94-95 explicitly describe Blindeforbundet's requirement for encrypted sensitive data dispatch with delivery and read receipts plus a 10-day reminder. The priority matrix (line 153) classifies this MUST for Blindeforbundet, Phase 2, which maps to target_release v1.0.
-
docs/source/likeperson.md · line 94-95- **Kryptert oppdragshåndtering:** Sende sensitive personopplysninger (navn, adresse, epikrise) til likepersoner med leveringsbekreftelse og lesebekreftelse. Statusoversikt over åpne oppdrag.
-
docs/source/likeperson.md · line 95- Automatisk påminnelse etter 10 dager dersom kontakt ikke er opprettet.
-
docs/source/likeperson.md · line 153| Kryptert oppdragshÃ¥ndtering | - | - | â | - | â | MUST (Blindeforbundet) | 2 |
Responsibilities
- Persist new assignments with encrypted payloads and initial status
- Update assignment status and append timestamped status-history records
- Query assignments by coordinator, status, and inactivity window for reminder processing
- Store and retrieve delivery and read-receipt event records
- Enforce row-level access control tied to coordinator identity
Interfaces
save(assignment: Assignment): Promise<Assignment>
findById(assignmentId: string): Promise<Assignment | null>
findByCoordinator(coordinatorId: string, filters: AssignmentFilters): Promise<Assignment[]>
findUncontactedOlderThan(days: number): Promise<Assignment[]>
updateStatus(assignmentId: string, event: StatusEvent): Promise<void>