Service Layer low complexity mobile
1
Dependencies
2
Dependents
0
Entities
0
Integrations

Description

Handles all business logic and CRUD operations for caregiver and next-of-kin records. Provides a reactive Riverpod provider stream so the contact detail screen receives both contact and caregiver list in a single subscription. Routes mutations through the offline mutation outbox for availability during home visits.

Feature: Caregiver & Next-of-Kin

caregiver-service

Responsibilities

  • Expose reactive stream of caregiver records for a given contactId
  • Create, update, and delete caregiver records in local Drift DB
  • Queue mutations in the outbox for backend sync when online
  • Validate relationship type against the allowed enum values

Interfaces

watchCaregiversForContact(contactId: String): Stream<List<Caregiver>>
createCaregiver(input: CaregiverInput): Future<void>
updateCaregiver(id: String, input: CaregiverInput): Future<void>
deleteCaregiver(id: String): Future<void>

Relationships

Dependencies (1)

Components this component depends on

Dependents (2)

Components that depend on this component