Activity Service
Component Detail
Service Layer
medium complexity
mobile
1
Dependencies
2
Dependents
5
Entities
0
Integrations
Description
Business logic layer for creating, validating, and submitting activity records. Posts validated activity drafts to the REST API, handles optimistic local cache updates, and invalidates the cache on successful server response to keep the local SQLite store consistent.
activity-service
Responsibilities
- Validate activity draft fields before submission (required fields, type constraints)
- POST activity to REST API endpoint and handle network errors with retry logic
- Invalidate local SQLite cache after successful remote write
- Provide the most recent activity for default-value seeding
Interfaces
createActivity(draft: ActivityDraft): Future<Activity>
getRecentActivity(userId: String): Future<Activity?>
validateDraft(draft: ActivityDraft): ValidationResult
Relationships
Dependents (2)
Components that depend on this component
Related Data Entities (5)
Data entities managed by this component