Activity Service
Component Detail
Service Layer
medium complexity
Shared Component
mobile
0
Dependencies
1
Dependents
5
Entities
0
Integrations
Description
Shared service responsible for persisting activity records via optimistic mutation and the Drift mutation outbox, supporting both quick-log and wizard submission paths. Handles conflict resolution, ID mapping for offline-created entities, and sync queue retry on reconnect.
activity-service
Sources & reasoning
The same optimistic mutation and outbox pattern used by the Quick Log Screen is reused by the wizard submission path - sharing this service prevents duplication and ensures consistent offline-first behaviour. It is shared with simple-activity-logging.
No source references — this artifact was included based on reasoning alone (see above).
Responsibilities
- Accept ActivityCreateRequest and write optimistically to local Drift store
- Enqueue mutation in outbox for background sync when online
- Map offline-generated IDs to server-assigned IDs on sync confirmation
- Expose rollback on API failure
Interfaces
ActivityService.createActivity(ActivityCreateRequest) Future<Activity>
ActivityService.rollback(String localId)
Relationships
Related Data Entities (5)
Data entities managed by this component