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

Description

Orchestrates the full mentor recommendation flow for a given assignment. Retrieves candidate mentors, computes geographic distances, applies eligibility filters, and returns a ranked suggestion list. Acts as the primary entry point for coordinator-initiated match requests.

Feature: Assignment Matching by Geography

geography-matching-service

Sources & reasoning

Line 99 directly ties geographic visualization to matching and assignment dispatch (oppdragstildeling), providing the provenance for this feature as a distinct matching capability beyond simple map display. Line 358 places it in Fase 3, normalizing to v1.1. The blueprint lists this feature under Geographic Map View at [v1.1]. Kept as a separate feature from peer-mentor-map because matching logic and the dispatch integration are distinct from rendering the map layer.

Responsibilities

  • Fetch candidate mentor pool from the mentor location repository
  • Invoke distance calculation for each candidate against the assignment target
  • Apply eligibility filters (certification, availability, workload threshold)
  • Compose and return ranked suggestion list sorted by composite score
  • Cache results per assignment ID to avoid redundant computation

Interfaces

getRankedSuggestions(assignmentId: string, filters: MatchFilters): Promise<RankedMentorSuggestion[]>
invalidateCache(assignmentId: string): void
preloadCandidates(region: string): Promise<void>

Related Data Entities (2)

Data entities managed by this component