Data Layer medium complexity Shared Component mobile
0
Dependencies
1
Dependents
2
Entities
0
Integrations

Description

Data access layer for the contacts table, shared across Contact List & Search and Contact Detail & Edit features. Abstracts REST API calls and local SQLite reads/writes, supporting offline-first access patterns. Coordinates with the Sync Service to queue pending mutations when the device is offline.

Feature: Contact Detail & Edit

contact-repository

Responsibilities

  • Read and write contact records to local SQLite cache
  • Proxy REST API calls for remote contact CRUD operations
  • Queue offline mutations for deferred sync via Sync Service
  • Resolve conflicts between local and remote contact state

Interfaces

findById(contactId: string): Future<Contact?>
findAll(filters: ContactFilters?): Future<List<Contact>>
save(contact: Contact): Future<Contact>
update(contactId: string, patch: Map<String, dynamic>): Future<Contact>
delete(contactId: string): Future<void>
queueOfflineMutation(mutation: ContactMutation): Future<void>
getPendingMutations(): Future<List<ContactMutation>>
clearPendingMutation(mutationId: string): Future<void>

Relationships

Dependents (1)

Components that depend on this component

Related Data Entities (2)

Data entities managed by this component