ContactRepository
Component Detail
Data Layer
medium complexity
mobile
0
Dependencies
0
Dependents
1
Entities
0
Integrations
Description
Data access layer that abstracts reads and writes between the remote REST API and the local Drift SQLite database. Implements an offline-first strategy by serving cached records immediately while triggering background sync. Exposes query methods supporting name and phone number search directly against the local store.
contact-repository
Sources & reasoning
Priority matrix (line 162) marks contact search MUST in Phase 1 across all four organizations. MVP scope narrative (line 320) lists contact list as Phase 1. Architecture section (line 291) confirms role-specific list views. Phase 1 in source docs maps to MVP by ordinal position (Fase 1 = first deliverable phase = MVP).
-
docs/source/likeperson.md · line 162Basic search (contact og notater) | ✓ | ✓ | ✓ | ✓ | ✓ | MUST | 1
-
docs/source/likeperson.md · line 320Kontaktliste og likepersonsoversikt
-
docs/source/likeperson.md · line 291Contacts list with role-specific views
Responsibilities
- Persist and retrieve contact records in the local Drift database
- Fetch contact data from the remote API and reconcile with local cache
- Execute name and phone number search queries against local SQLite
- Track sync timestamps and dirty flags for incremental updates
- Expose reactive data streams for real-time downstream updates
Interfaces
getContactsByOwner(ownerId: string): Stream<List<Contact>>
getAllContacts(): Stream<List<Contact>>
searchByNameOrPhone(query: string): Future<List<Contact>>
upsertContacts(contacts: List<Contact>): Future<void>
getLastSyncTimestamp(): Future<DateTime?>