Contact Search Service
Component Detail
Description
Riverpod-based repository provider that executes role-filtered FTS5 full-text search queries against the local Drift database. Applies a user_id WHERE clause for peer mentors and an organization_id scope for coordinators at query time. Exposes a stream of paginated contact results and handles query debounce.
contact-search-service
Sources & reasoning
Business logic layer that enforces role-scoped filtering and full-text search. The implementation notes explicitly state role filtering is applied at query time via a Riverpod ContactsRepository provider, making this a required and standalone service component distinct from the UI and data layers.
-
docs/source/likeperson.md ยท line 152Basic search (contact og notater) | โ | โ | โ | โ | MUST | 1
-
docs/source/likeperson.md ยท line 284Contacts list with role-specific views
-
docs/source/likeperson.md ยท line 311Kontaktliste og likepersonsoversikt
Responsibilities
- Apply role-scoped WHERE clause (user_id for peer mentor, organization_id for coordinator)
- Execute SQLite FTS5 full-text search across contact name and notes fields
- Return paginated streams of contact results for infinite scroll
- Debounce search input to prevent excessive DB queries
- Expose Riverpod provider consumed by Contact List Screen
Interfaces
searchContacts(String query, int offset, int limit) โ Stream<List<Contact>>
getContacts(int offset, int limit) โ Stream<List<Contact>>
watchContactCount() โ Stream<int>
Relationships
Dependencies (2)
Components this component depends on
Dependents (3)
Components that depend on this component
Related Data Entities (4)
Data entities managed by this component