Data Layer low complexity Shared Component backend
0
Dependencies
0
Dependents
2
Entities
0
Integrations

Description

Data access layer for reading peer_mentor_locations records during suggestion ranking. Provides indexed queries by organization and active status to support efficient bulk lookups required for distance computation across the full mentor pool. Does not own writes - location updates are owned by the Geolocation Service in the Peer Mentor Map feature.

Feature: Assignment Matching by Geography

peer-mentor-location-repository

Sources & reasoning

Geographic Match Service needs efficient read access to peer_mentor_locations for distance computation. Isolating this as a repository avoids duplicating query logic with the Geolocation Service in the Peer Mentor Map feature, making it a shared data component across both geographic-map-view features.

No source references — this artifact was included based on reasoning alone (see above).

Responsibilities

  • Query peer_mentor_locations by organization ID with active-status filter
  • Batch-fetch location records for a list of user IDs to support ranking computation
  • Provide existence check for whether a mentor has a recorded location

Interfaces

getMentorLocationsByOrg(orgId: string): Promise<PeerMentorLocation[]>
getMentorLocationsByUserIds(userIds: string[]): Promise<PeerMentorLocation[]>
hasLocation(userId: string): Promise<boolean>

Related Data Entities (2)

Data entities managed by this component