Peer Mentor Detail BLoC
API Contract
REST
/api/v1/peer-mentor-bloc
5 endpoints
GET
/api/v1/peer-mentor-bloc/api/v1/peer-mentor-bloc/:mentor_id
Load full BLoC-driven mentor detail state (profile + certs + activity + assignments merged)
Public
Response Example
{
"mentor_id": "mentor_a1b2c3",
"state": "loaded",
"profile": {
"full_name": "Kari Nordmann",
"email": "kari.nordmann@frivillig.no",
"org_id": "org_x9y8z7",
"status": "active",
"is_paused": false
},
"certification": {
"expiry_date": "2028-01-20T00:00:00Z",
"days_until_expiry": 665,
"is_within_warning_window": false
},
"activity_summary": {
"total_sessions": 8,
"total_activities": 12,
"period": "month"
},
"active_assignments": [
{
"assignment_id": "assign_001aa",
"contact_name": "Per Olsen",
"status": "open"
},
{
"assignment_id": "assign_002bb",
"contact_name": "Liv Svendsen",
"status": "open"
}
],
"loaded_at": "2026-03-26T10:00:00Z"
}
GET
/api/v1/peer-mentor-bloc/api/v1/peer-mentor-bloc
List BLoC-resolved mentor states for org dashboard
Public
Response Example
{
"data": [
{
"mentor_id": "mentor_a1b2c3",
"state": "loaded",
"full_name": "Kari Nordmann",
"status": "active",
"open_assignment_count": 2,
"days_until_expiry": 665
}
],
"pagination": {
"page": 1,
"limit": 20,
"total": 48
}
}
POST
/api/v1/peer-mentor-bloc/api/v1/peer-mentor-bloc
Dispatch LoadMentorDetail event — returns initial loading state
Public
Request Example
{
"event": "LoadMentorDetail",
"mentor_id": "mentor_a1b2c3"
}
Response Example
{
"mentor_id": "mentor_a1b2c3",
"state": "loading",
"dispatched_at": "2026-03-26T10:00:00Z"
}
PUT
/api/v1/peer-mentor-bloc/api/v1/peer-mentor-bloc/:mentor_id
Dispatch RefreshMentorDetail event — forces re-fetch of all sub-resources
Public
Request Example
{
"event": "RefreshMentorDetail"
}
Response Example
{
"mentor_id": "mentor_a1b2c3",
"state": "refreshing",
"previous_loaded_at": "2026-03-26T09:00:00Z",
"refresh_dispatched_at": "2026-03-26T10:05:00Z"
}
DELETE
/api/v1/peer-mentor-bloc/api/v1/peer-mentor-bloc/:mentor_id
Clear BLoC state cache for a mentor (next GET will reload)
Public
Response Example
{
"cleared": true,
"mentor_id": "mentor_a1b2c3"
}