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

Description

Riverpod-managed service layer handling scoped CRUD operations for relative records via the REST endpoint /api/v1/contacts/:id/relatives. Applies optimistic mutations with automatic rollback on failure and channels offline writes through the Drift mutation outbox.

Feature: Relative Contact Registration

relative-service

Sources & reasoning

Business logic layer required to manage the full CRUD lifecycle of relative records through the scoped REST endpoint, with Riverpod state management, optimistic mutations following the same pattern used by the contacts feature, and offline mutation outbox support.

No source references — this artifact was included based on reasoning alone (see above).

Responsibilities

  • Fetch paginated relatives list for a given parent contact from backend
  • Create, update, and delete relative records via scoped REST API
  • Apply optimistic mutations and roll back on API failure
  • Queue offline mutations in the Drift outbox and resolve server IDs on sync

Interfaces

getRelatives(contactId)
createRelative(contactId, RelativeDto)
updateRelative(relativeId, RelativeDto)
deleteRelative(relativeId)
syncPendingMutations()