HomeVisitReportRepository
Component Detail
Data Layer
medium complexity
backend
0
Dependencies
0
Dependents
1
Entities
0
Integrations
Description
Handles all persistence operations for home-visit reports, drafts, and the coordinator tasks generated from them. Provides typed queries for retrieving reports by visit, submitter, and coordinator, and manages the relationship between report records and their derived task records.
home-visit-report-repository
Sources & reasoning
Lines 96 and 121 define the structured report domains and confirm the feature is shared between Blindeforbundet and Barnekreftforeningen. Line 355 places the feature in Fase 3 of the roadmap. Blueprint assigns [v1.1] matching the Fase 3 ordinal position.
-
docs/source/likeperson.md · line 96Formalisert rapportstruktur etter hjemmebesøk: Helsetilstand, kursinteresse, hjelpemiddelsituasjon, «veien videre» - fungerer som bestilling til koordinatoren.
-
docs/source/likeperson.md · line 121Formalisert rapportstruktur (delt med Blindeforbundet): kort strukturert etterrapport etter hjemmebesøk eller samtale, som fungerer som bestilling til koordinator.
-
docs/source/likeperson.md · line 355Formalisert rapportstruktur (Blindeforbundet + Barnekreftforeningen)
Responsibilities
- Persist finalized home-visit report records with all domain sections as structured columns
- Store and retrieve draft reports keyed by visit ID and user ID
- Save coordinator tasks generated from report way-forward sections with foreign key to parent report
- Query reports by visit ID, peer mentor ID, date range, and coordinator assignee
- Delete expired drafts on a scheduled basis to prevent storage accumulation
Interfaces
saveReport(report: HomeVisitReport): string
getReport(reportId: string): HomeVisitReport | null
getReportsByVisit(visitId: string): HomeVisitReport[]
saveDraft(draft: HomeVisitReportDraft): void
getDraft(visitId: string, userId: string): HomeVisitReportDraft | null
saveCoordinatorTasks(tasks: CoordinatorTask[]): void
getTasksByReport(reportId: string): CoordinatorTask[]