PeerMentorStatusService
Component Detail
Service Layer
medium complexity
backend
0
Dependencies
0
Dependents
7
Entities
0
Integrations
Description
Backend service that manages the business logic for pausing and resuming peer mentor availability. It orchestrates the status update, removes or restores the mentor from active assignment pools, and triggers coordinator notifications via the push notification system. All transitions are recorded to preserve service history.
peer-mentor-status-service
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
- Validate that the requesting user has the peer-mentor role before allowing status changes
- Update mentor status to paused or active in the data layer
- Remove paused mentors from active assignment pools and restore them on resume
- Trigger coordinator notification on pause event via push notification dependency
- Log status change events for audit and history preservation
Interfaces
pauseMentor(mentorId: string, reason?: string): Promise<MentorStatus>
resumeMentor(mentorId: string): Promise<MentorStatus>
getMentorStatus(mentorId: string): Promise<MentorStatus>
notifyCoordinators(mentorId: string, event: StatusEvent): Promise<void>
Related Data Entities (7)
Data entities managed by this component