828 B
828 B
Shared Package
Purpose: shared domain types and pure logic.
Implement here:
- domain types,
- profile thresholds,
- segment scoring,
- route scoring,
- critical gap detection,
- stage helper functions,
- GPX serialization helpers if shared with API.
Pure functions should have unit tests and deterministic fixtures.
Implemented functions
scoreSegment(segment, profile)scoreRoute(route, profile)estimateHikeABikeRisk(segment, profile)filterPoisByCorridor(pois, route, filter)detectCriticalGaps(route, pois, thresholds)planStages(route, pois, tripRequest)exportRouteToGpx(route, stages, pois, options)createOfflinePackManifest(input)
The mock trip request is kept aligned with examples/sample_trip_request.json; tests cover scoring, staging, POI corridor/gaps, and GPX export.