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

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.

Feature: Contact List & Search

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 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

  • 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