Wizard State Service
Component Detail
Service Layer
medium complexity
mobile
0
Dependencies
0
Dependents
0
Entities
0
Integrations
Description
Manages the in-progress draft state of an active wizard session across steps. Holds intermediate field values, tracks which steps have been completed, and exposes validation hooks consumed by the wizard UI. Persists drafts locally so an interrupted session can be resumed.
wizard-state-service
Sources & reasoning
The mobile-app architecture section explicitly lists the multi-step Activity wizard, and §1.2 motivates the step-by-step layout for cognitive accessibility. Both belong to MVP per the Fase 1 mobile scope in §5.
-
docs/source/likeperson.md · line 221-222Activity wizard (multi-step: contact → date → time → duration → summary)
-
docs/source/likeperson.md · line 19-23Kognitiv tilgjengelighet: NHF nevner spesifikt slagrammede. Enkel navigasjon, logisk flyt, ikke for mange valg ... Tilbakeknapp fremfor sidelengs-sveip.
Responsibilities
- Maintain the current wizard draft and per-step completion state
- Validate field values for each step and expose error state
- Persist and restore in-progress drafts across app sessions
- Compose the final activity payload for submission
- Reset state cleanly on cancel or successful submission
Interfaces
initDraft(seed?): WizardDraft
updateField(stepId, field, value): ValidationResult
validateStep(stepId): ValidationResult
buildActivityPayload(): ActivityInput
clearDraft(): void