Contact Update Service
Component Detail
Service Layer
medium complexity
mobile
3
Dependencies
1
Dependents
1
Entities
0
Integrations
Description
Domain service orchestrating the optimistic mutation pattern for contact edits. Immediately writes the updated contact to local Drift storage, enqueues the change in the mutation outbox for background sync to the REST API, and restores the original record snapshot with a user-facing error notification if the remote sync operation fails. Delegates field validation to the domain layer before persisting any changes.
contact-update-service
Responsibilities
- Validate contact field values against domain rules before persisting
- Apply optimistic update to the local Drift contacts record immediately
- Enqueue the contact mutation in the mutation outbox for backend sync
- Restore the original record snapshot and surface error on sync failure
Interfaces
updateContact(contactId: String, update: ContactUpdate): Future<void>
rollbackContact(contactId: String, snapshot: Contact): Future<void>
Relationships
Dependencies (3)
Components this component depends on