PeerMentorStatusRepository
Component Detail
Data Layer
medium complexity
backend
0
Dependencies
0
Dependents
1
Entities
0
Integrations
Description
Data access layer responsible for persisting and querying peer mentor status records. It provides atomic status updates and maintains a full history of status transitions so that service records are never lost when a mentor pauses or resumes. Queries support filtering active mentors for assignment pool logic.
peer-mentor-status-repository
Sources & reasoning
Section 2.3 and the priority matrix (line 150) confirm this as SHOULD HAVE at Fase 2 for NHF, HLF, and Barnekreftforeningen. Fase 2 maps to v1.0 by roadmap ordinal (Fase 1=MVP, Fase 2=v1.0, Fase 3=v1.1). The feature directly reduces volunteer churn and is a cross-org requirement.
-
docs/source/likeperson.md · line 80Likepersoner skal kunne sette seg på pause (midlertidig deaktivering) uten å melde seg ut. Koordinator må varsles.
-
docs/source/likeperson.md · line 150| Pausefunksjon for likepersoner | ✓ | ✓ | - | ✓ | ✓ | SHOULD HAVE | 2 |
Responsibilities
- Read and write the current status field on peer mentor records
- Insert status transition history entries on every pause or resume action
- Query all currently active mentors for use by assignment pool services
- Ensure status updates are atomic to prevent partial writes
- Support soft-filtering of paused mentors without deleting any records
Interfaces
updateStatus(mentorId: string, status: MentorStatus): Promise<void>
getStatus(mentorId: string): Promise<MentorStatus>
getActiveMentors(): Promise<PeerMentor[]>
insertStatusHistory(entry: StatusHistoryEntry): Promise<void>
getStatusHistory(mentorId: string): Promise<StatusHistoryEntry[]>