ContactRepository
Component Detail
Data Layer
medium complexity
backend
0
Dependencies
0
Dependents
1
Entities
0
Integrations
Description
Data access layer responsible for querying and returning contact records from persistent storage. Supports filtered queries by assignment, association scope, and search terms across name and identifier fields. Provides pagination-aware result sets for efficient list rendering.
contact-repository
Sources & reasoning
Line 162 explicitly marks contact search as MUST HAVE Phase 1 for all five organisations. Line 291 confirms role-specific views as a core mobile architecture requirement. Line 467 canonically places this feature in the Contacts area taxonomy. MVP target derives from the Phase 1 position in the priority matrix and from line 321 listing contact list as a Phase 1 deliverable.
-
docs/source/likeperson.md · line 162| Basic search (contact og notater) | ✓ | ✓ | ✓ | ✓ | ✓ | MUST | 1 |
-
docs/source/likeperson.md · line 291- Contacts list with role-specific views
-
docs/source/likeperson.md · line 467| contacts | Contacts | Contact List & Search, Contact Detail & Edit, Caregiver & Next-of-Kin |
Responsibilities
- Query contact records filtered by assigned peer mentor or association scope
- Execute full-text and partial-match searches across name and identifier columns
- Return paginated result sets with total count metadata for UI pagination controls
- Fetch individual contact records by ID for detail view consumption
- Cache frequently accessed contact lists to reduce redundant database round-trips
Interfaces
findByAssignment(mentorId: string, page: number, pageSize: number): Promise<PaginatedResult<ContactRecord>>
findByAssociation(associationId: string, page: number, pageSize: number): Promise<PaginatedResult<ContactRecord>>
search(query: string, scopeFilter: ScopeFilter): Promise<ContactRecord[]>
findById(contactId: string): Promise<ContactRecord | null>