Geographic Matching Service
Component Detail
Service Layer
high complexity
mobilebackend
0
Dependencies
0
Dependents
3
Entities
0
Integrations
Description
Core business logic service that retrieves peer mentor location and availability data, computes proximity rankings relative to a target assignment location, and applies GDPR-compliant privacy rules. Uses municipality or postal code area centroids rather than real-time GPS to protect mentor privacy while enabling effective geographic matching for coordinators.
geographic-matching-service
Responsibilities
- Fetch peer mentor locations within coordinator's organisation scope
- Rank mentors by proximity to a given assignment location centroid
- Filter mentors by availability status before ranking
- Enforce GDPR opt-in check before including mentor locations
- Apply RLS-compliant data access (same-organisation constraint)
Interfaces
getMentorLocationsForCoordinator(coordinatorId)
rankMentorsByProximity(assignmentLocation, mentors)
filterByAvailability(mentors, status)
getOptInConsentStatus(mentorId)
getMentorAreaCentroid(mentorId)
validateOrganisationScope(coordinatorId, mentorId)
buildLocationPayload(mentors)
Related Data Entities (3)
Data entities managed by this component