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

Description

Business logic service handling all geospatial operations for the map feature. Delegates geocoding and reverse geocoding to the backend API to avoid exposing mapping API keys on the client. Calculates distances between mentor coordinates and a reference point for sorting and display, and manages GDPR-compliant consent state for storing location data.

Feature: Geographic Map View for Peer Mentor Matching

location-service

Responsibilities

  • Geocode peer mentor addresses to lat/lng coordinates via backend API
  • Calculate distances between mentor and contact locations using Haversine formula
  • Sort mentor list by proximity to a reference coordinate
  • Enforce GDPR consent check before accessing or storing location data

Interfaces

geocodeAddress(String address) -> Future<LatLng?>
reverseGeocode(LatLng coords) -> Future<String?>
calculateDistance(LatLng from, LatLng to) -> double
sortMentorsByProximity(List<PeerMentor> mentors, LatLng reference) -> List<PeerMentor>
getMentorsInBounds(LatLngBounds bounds) -> Future<List<PeerMentor>>
hasLocationConsent() -> bool
requestLocationConsent() -> Future<bool>

Relationships

Dependencies (1)

Components this component depends on

Dependents (1)

Components that depend on this component

Related Data Entities (2)

Data entities managed by this component