View and resume a draft post-session report
Peer mentors sometimes need to complete reports in multiple sessions — for example, if they are interrupted during reporting or need to look up information. The report form should support draft state, persisting all entered data locally and in the database so the peer mentor can return to it and complete it at any time. A draft indicator should be visible on the home screen and contact detail screen to remind the peer mentor of pending reports.
User Story
Audience Summaries
Draft report persistence directly tackles report abandonment — one of the most significant sources of data loss in the peer mentor workflow. Peer mentors operate in contexts where interruptions are common: public transport, care settings, and shared spaces. Without draft support, any interruption results in complete loss of entered report data, discouraging future reporting attempts and degrading the quality of coordinator oversight and Bufdir compliance data. By auto-saving drafts locally and to the database, the platform ensures peer mentor effort is never wasted and reports are completed on the mentor's own schedule.
Visible draft indicators on the home and contact screens create a low-friction nudge system that sustains reporting momentum without relying on external reminders. This directly increases report submission rates, which is a core KPI for the platform's value to partner organisations.
This story depends on the structured post-session report (story-structured-post-session-report-peer-mentor-001) and must be sequenced after that form is stable. Delivery involves both client-side persistence (local draft storage to handle offline or interrupted sessions) and server-side draft state in the database, requiring coordination between frontend and backend developers. Five acceptance criteria cover the full lifecycle — creation, visibility, restoration, finalisation, and discard — each needing explicit test coverage including edge cases such as multiple drafts per contact or drafts for contacts with no prior reports. UX design input is needed for the draft indicator placement on both the home screen and contact profile.
Stakeholder sign-off is required on the discard confirmation flow to avoid accidental data loss. Risk: if local and server drafts can diverge (e.g., offline edits), a conflict resolution strategy must be defined before implementation begins.
Implementation requires adding draft state management to the post-session report form, with auto-save triggered on field change or navigation-away events. Drafts must be persisted in two layers: local storage (or equivalent mobile cache) for offline resilience, and a `draft` status field in the report database table with a partial JSON payload of entered field values. A database migration is needed to add draft status and partial content columns. The report restoration flow must deserialise and repopulate all form fields exactly, preserving field order, validation state, and any conditional logic.
Draft indicator components must be added to the home screen and contact detail page, querying for any reports with draft status linked to the relevant contact. The discard flow requires a confirmation dialog followed by deletion of both local and server-side draft data. Key edge cases: simultaneous edits across devices, draft expiry policy, and behaviour when the underlying contact record is modified after a draft is created. Ensure idempotent save logic to avoid duplicate draft records on rapid field changes.
Acceptance Criteria
- Given a peer mentor starts filling in a post-session report but does not submit it, when they navigate away, then the partially completed form is saved as a draft
- Given a draft report exists, when the peer mentor opens the contact's profile or the home screen, then a clear 'draft report pending' indicator is shown
- Given a peer mentor taps the draft indicator, when they are navigated to the report form, then all previously entered data is restored exactly as left
- Given a draft has been restored, when the peer mentor completes and submits it, then the report is finalised and the draft indicator is cleared
- Given a peer mentor decides to discard a draft, when they confirm the discard action, then all draft data is deleted and the indicator is removed
Business Value
Draft support is essential for reducing report abandonment. Peer mentors who cannot complete a report in one sitting — due to transport, interruption, or need for reflection — currently risk losing all entered data. By supporting draft persistence, the system protects the peer mentor's effort and ensures reports are completed and submitted rather than abandoned, directly improving data completeness for coordinators and Bufdir reporting.
Components
- Post-Session Report Screen ui
- Report Form Orchestrator service
- Post-Session Report Repository data
- Wizard State Manager service
- Wizard Draft Repository data