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

Description

Service layer that mediates all read and write operations against the on-device encrypted database. It exposes a domain-aware API for activities, contacts, notes, and receipts so that feature code never touches Drift directly.

Feature: Offline Data Support

local-db-service

Sources & reasoning

Listed as a Mobile App area feature in the canonical taxonomy (§8) and explicitly described in the Mobile App Architecture Core/Shared section as offline-first encrypted persistence. Field-work context in §1.1 makes offline non-negotiable, so MVP.

  • Offline-first persistence (Drift + SQLCipher encrypted local DB, mutation outbox, sync queue with retry/backoff, ID mapping for offline-created entities, conflict resolver)
  • offline-sync | Offline & Sync | Offline Data Support, Background Sync

Responsibilities

  • Provide CRUD operations for offline-capable domains (activities, contacts, notes, receipts)
  • Manage Drift database connections and transactions
  • Mirror the server-side schema for offline-editable entities
  • Track local change state for later synchronization
  • Enforce role-based access to local data per active session

Interfaces

saveActivity(activity): Future<void>
getContacts(filter): Future<List<Contact>>
updateNote(noteId, content): Future<void>
saveReceipt(receipt): Future<void>
getPendingChanges(): Future<List<ChangeRecord>>

Related Data Entities (3)

Data entities managed by this component