Service Layer medium complexity mobile
0
Dependencies
0
Dependents
6
Entities
0
Integrations

Description

The service layer that orchestrates persisting a completed wizard activity registration to the backend. It constructs the final activity payload from aggregated wizard form data, calls the activity creation API, and handles offline queuing when the device has no connectivity. It also validates the complete payload against business rules before submission.

Feature: Activity Registration Wizard

activity-wizard-service

Sources & reasoning

Line 296 defines the wizard's multi-step flow in the Mobile App Architecture section. Line 316 places activity registration in Fase 1 MVP. Blueprint assigns [MVP] confirming launch-critical status. The wizard complements quick logging for activities requiring full context and is a dependency for downstream features including document attachments and formalized home-visit reports.

  • docs/source/likeperson.md · line 296
    Activity wizard (multi-step: contact → date → time → duration → summary)
  • docs/source/likeperson.md · line 316
    Aktivitetsregistrering med lavest mulig antall klikk og standardverdier

Responsibilities

  • Validate the complete WizardFormData payload against business rules
  • Submit the activity registration to the backend API
  • Queue the registration for offline sync when connectivity is unavailable
  • Map wizard form data to the canonical ActivityRecord format
  • Emit success or structured error results back to the calling screen

Interfaces

submitActivity(data: WizardFormData): Promise<ActivityRecord>
validatePayload(data: WizardFormData): ValidationResult
queueOfflineActivity(data: WizardFormData): void
getQueuedActivities(): WizardFormData[]