Service Layer medium complexity backend
2
Dependencies
0
Dependents
1
Entities
0
Integrations

Description

REST endpoint handler at GET /api/v1/assignments/:id/suggested-mentors that validates the caller's authorization, checks the geographic-map-view module toggle for the caller's tenant, delegates ranking to Geographic Match Service, and serializes the response. Returns 403 when the module is disabled and an unranked fallback list when location data is insufficient for ranking.

Feature: Assignment Matching by Geography

mentor-suggestion-endpoint

Sources & reasoning

Separating the HTTP boundary from the ranking logic keeps Geographic Match Service testable in isolation. The endpoint enforces the module toggle gate and authorization before any distance computation is performed, matching the platform's backend-is-source-of-truth module enforcement pattern.

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

Responsibilities

  • Validate JWT bearer token and extract caller organization context
  • Gate request on geographic-map-view module toggle, returning 403 if disabled
  • Delegate to Geographic Match Service and return ranked or fallback suggestion list
  • Serialize ranked mentor suggestions with distance metadata stripped to required precision

Interfaces

GET /api/v1/assignments/:id/suggested-mentors
handleSuggestedMentors(req: Request, res: Response): Promise<void>

Relationships

Dependencies (2)

Components this component depends on

Related Data Entities (1)

Data entities managed by this component