Location Repository
Component Detail
Data Layer
medium complexity
backend
0
Dependencies
0
Dependents
2
Entities
0
Integrations
Description
Data access layer for peer mentor location records stored as municipality or postal code area centroids in the peer_mentor_locations table. Enforces row-level security so only coordinators within the same organisation can read location data. Provides CRUD operations for location records and consent flags.
location-repository
Responsibilities
- Read peer mentor location centroids with RLS organisation filter
- Create and update mentor home area location records
- Store and retrieve GDPR consent flags per mentor
- Delete location records on consent withdrawal
- Support batch fetch for all mentors in an organisation
Interfaces
getLocationsByOrganisation(orgId)
getMentorLocation(mentorId)
upsertMentorLocation(mentorId, centroid, consentGranted)
deleteLocation(mentorId)
getConsentFlag(mentorId)
updateConsentFlag(mentorId, granted)
batchGetLocations(mentorIds)
Related Data Entities (2)
Data entities managed by this component