Infrastructure medium complexity Shared Component backend
0
Dependencies
0
Dependents
1
Entities
0
Integrations

Description

Wraps the external geocoding API used to convert free-text location strings into coordinate pairs. Applies request batching, response caching, and retry logic. Required when assignment target addresses arrive as text rather than pre-resolved coordinates.

Feature: Assignment Matching by Geography

geocoding-client

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

  • Geocode a single address string to Coordinates
  • Batch geocode multiple addresses in a single API round-trip
  • Cache responses with configurable TTL to reduce API cost
  • Retry transient failures with exponential backoff
  • Surface quota exhaustion errors with actionable diagnostics

Interfaces

geocode(address: string): Promise<Coordinates>
geocodeBatch(addresses: string[]): Promise<(Coordinates | null)[]>
clearCache(): void
getQuotaStatus(): QuotaStatus

Related Data Entities (1)

Data entities managed by this component