Skip to content

VSN-2100/ feat(passenger trip tracking): Add GET endpoint for polling latest driver position

fatima senan a demandé de fusionner feature/VSN-2100 vers develop

This MR adds GET /api/location/driver/latest?driverUuid={uuid} endpoint to enable HTTP polling as an alternative to SSE streaming for user mobile app.

Following tech lead review, the following improvements were added across the service:

  • Validation : UUID format validation
  • Performance : in-memory position cache, singleflight request coalescing, gzip compression
  • Résilience : rate limiting (200 req/min per IP), concurrency semaphore (max 100), MongoDB query timeout (5s)
  • HTTP caching : Cache-Control headers, ETag generation with If-None-Match → 304 Not Modified
  • Data quality : position freshness check (max 5 min age), invalid coordinates filtered out
  • Observabilité : structured zerolog metrics (duration_ms, method, coordinates), OpenAPI annotations
Modification effectuée par fatima senan

Rapports de requête de fusion