Data Layer medium complexity mobile
0
Dependencies
0
Dependents
0
Entities
0
Integrations

Description

Persists in-progress wizard state locally so peer mentors can save drafts between sessions and resume without data loss. Stores partial activity data keyed by draft ID and exposes CRUD operations consumed by the wizard controller. Syncs completed drafts to the backend once connectivity is available.

Feature: Activity Registration Wizard

activity-draft-store

Sources & reasoning

The mobile architecture section (line 296-298) explicitly lists the wizard as a named screen in the app. The WCAG dragging-movements rule (line 36) directly constrains its navigation pattern. Fase 1 / MVP in the roadmap section (line 405).

  • docs/source/likeperson.md ยท line 296-298
    Activity wizard (multi-step: contact โ†’ date โ†’ time โ†’ duration โ†’ summary)
  • Tilbakeknapp fremfor sidelengs-sveip. Vertikal scroll er normen.

Responsibilities

  • Save and update partial ActivityDraft records to local storage
  • Retrieve existing drafts by ID or list all pending drafts for the current user
  • Delete drafts after successful submission or explicit discard
  • Queue completed drafts for background sync when offline
  • Enforce draft expiry policy to prevent stale data accumulation

Interfaces

saveDraft(draft: Partial<ActivityDraft>): Promise<string>
getDraft(draftId: string): Promise<ActivityDraft | null>
listDrafts(userId: string): Promise<ActivityDraft[]>
deleteDraft(draftId: string): Promise<void>
syncPendingDrafts(): Promise<SyncResult>