HomeVisitReportService
Component Detail
Service Layer
medium complexity
backend
0
Dependencies
0
Dependents
2
Entities
0
Integrations
Description
Orchestrates home-visit report submission, validation, and coordinator task generation. Enforces reporting completeness rules required by Blindeforbundet and Barnekreftforeningen and translates way-forward entries into structured coordinator tasks. Acts as the boundary between the mobile form and backend persistence.
home-visit-report-service
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
- Validate report payload against required domain schema before persistence
- Transform way-forward section entries into coordinator task records with correct assignment and priority
- Persist finalized report and generated tasks atomically so partial saves cannot occur
- Notify assigned coordinator when a new report with pending tasks arrives
- Expose draft save and retrieval so reports survive app restarts mid-completion
Interfaces
validateReport(payload: HomeVisitReportPayload): ValidationResult
submitReport(payload: HomeVisitReportPayload, submitterId: string): HomeVisitReportResult
generateCoordinatorTasks(wayForward: WayForwardSection, reportId: string): CoordinatorTask[]
saveDraft(draft: HomeVisitReportDraft, userId: string): void
getDraft(visitId: string, userId: string): HomeVisitReportDraft | null
Related Data Entities (2)
Data entities managed by this component