Mentor Program Repository
Component Detail
Data Layer
medium complexity
backendmobile
0
Dependencies
0
Dependents
4
Entities
0
Integrations
Description
Data access layer persisting mentor-mentee pairings and milestone data to Supabase. Applies row-level security policies ensuring coordinators can create or dissolve pairings while peer mentors have read-only access to their own records. Manages the mentor_pairings join table and the mentor_programme_role extension on peer_mentors.
mentor-program-repository
Responsibilities
- Persist and retrieve mentor_pairings records with full CRUD
- Enforce Supabase row-level security policies for role-based access
- Manage milestone records linked to pairings
- Query available mentors with filters (geography, availability, specialisation)
Interfaces
createPairing(data)
getPairing(pairingId)
getPairingsByCoordinator(coordinatorId)
getPairingsByMentor(mentorId)
updatePairing(pairingId, updates)
deletePairing(pairingId)
upsertMilestone(pairingId, milestone)
getMilestones(pairingId)
getAvailableMentors(filters)
updateMentorProgrammeRole(mentorId, role)
Related Data Entities (4)
Data entities managed by this component