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

Description

Drift table and repository for the contacts entity, with SQLite FTS5 virtual table for full-text search across name and notes fields. Provides reactive streams via Drift's watchStatement API. Mutations are enqueued through the shared offline outbox when the device is offline.

Feature: Contact List & Search

contacts

Sources & reasoning

Core data component required by all three Contacts area features (contact-list-search, contact-detail-edit, caregiver-next-of-kin). FTS5 is the mechanism enabling full-text search without a network call. Marked shared because contact-detail-edit and caregiver-next-of-kin will read and write the same Drift table.

  • docs/source/likeperson.md ยท line 152
    Basic search (contact og notater) | โœ“ | โœ“ | โœ“ | โœ“ | MUST | 1
  • docs/source/likeperson.md ยท line 284
    Contacts list with role-specific views
  • docs/source/likeperson.md ยท line 311
    Kontaktliste og likepersonsoversikt

Responsibilities

  • Define Drift table schema for contacts with FTS5 virtual table
  • Expose watchAllContacts and watchContactById reactive streams
  • Support batch upsert for sync reconciliation from the server
  • Delegate offline mutations to the shared Mutation Outbox Service
  • Enforce organization-level data isolation at the query layer

Interfaces

watchContacts(String? ftsQuery, String? userId, String? organizationId, int offset, int limit) โ†’ Stream<List<ContactEntity>>
upsertContact(ContactEntity contact) โ†’ Future<void>
upsertContacts(List<ContactEntity> contacts) โ†’ Future<void>
watchContactById(String id) โ†’ Stream<ContactEntity?>
deleteContact(String id) โ†’ Future<void>

Relationships

Dependencies (1)

Components this component depends on

Dependents (2)

Components that depend on this component