Commit Graph

22 Commits

Author SHA1 Message Date
0d603ad15f fix: address code review findings 2026-08-18 14:25:34 +03:00
48650d96cf fix: address code review findings 2026-08-18 13:57:30 +03:00
8aecaf1468 fix: address code review findings 2026-08-17 23:40:52 +03:00
9b89b7b9ab fix: address code review findings 2026-08-17 23:12:24 +03:00
6dcec6a7a5 fix: address code review findings
- Fix type mismatch in search_cache.go: SearchWithCache now returns *yandex.Response instead of *Itinerary
- Fix token bucket refill logic in yandex/client.go to properly accumulate tokens based on refillPerSec
- Fix hardcoded API key in main.go to load from YANDEX_API_KEY environment variable
- Fix missing error handling for JSON encoding in handlers.go RouteGeoJSON function
- Fix incorrect redis.Nil handling in cache/store.go CacheAside.Exists method
- Fix incorrect error return type in station_status.go updateStationStatus to return newStatus instead of empty string
2026-08-17 22:42:08 +03:00
78f662c985 fix: address code review findings 2026-08-17 22:14:48 +03:00
777fda95a3 fix: address code review findings 2026-08-17 21:50:37 +03:00
9c402c0086 fix: address code review findings 2026-08-17 21:19:36 +03:00
81686e9adc feat: Full test suite and linter - fixed test failures and increased coverage to 61.1% 2026-08-17 17:00:10 +03:00
c58fbb50b1 feat: implement observability and metrics (Task 22)
- Add metrics package tracking cache hit-rate, API quota, circuit breaker trips, search time
- Integrate metrics with cache layer, yandex client, and API handlers
- Add /metrics HTTP endpoint for Prometheus-compatible metrics exposure
- Write tests for metrics functionality across cache, yandex, and API handlers
- Update test files to support new metrics infrastructure
2026-08-17 15:27:44 +03:00
5842667fff feat: Implement user preferences (saved cities, search history) with Redis storage and API handlers 2026-08-17 14:30:54 +03:00
d67bc5aca7 feat: Implement Pareto-front ranking integration with multi-criteria sorting
- Add RankingMode field to SearchOptions (fastest/fewest_transfers/cheapest)
- Update FindRoutesPareto to respect ranking mode when sorting
- Add ranking_mode query parameter to RouteSearch endpoint
- Add TestParetoFrontGeneration with subtests for all three modes

Co-Authored-By: Claude <noreply@anthropic.com>
2026-08-16 19:27:02 +03:00
026b779cb3 feat: Implement lazy hub expansion depth limiting with MaxTransfers support
- Add transfer depth limiting in BFS/Dijkstra (MaxTransfers field in SearchOptions)
- Track transfer count at each step; stop when depth > 5
- Synthetic edge fallback on expansion failure
- Add TestLazyExpansionDepthLimit and TestFindRouteMaxTransfers tests

Co-Authored-By: Claude <noreply@anthropic.com>
2026-08-16 18:59:48 +03:00
7c6fe4a99c feat: Implement lazy hub expansion depth limiting with transfer depth limit of 5 (Task 14) 2026-08-16 18:17:36 +03:00
06730fe05c feat: Implement synthetic edges city↔airport (Task 10)
- Add TransferTime constants (AirportToCity, CityToStation, StationToStation)
- Update Edge struct with Synthetic field
- Enhance addSyntheticEdgesForNode to use constants and mark synthetic edges
- Update BuildGraphFromStations to set Synthetic field
- Mark synthetic edges in GeoJSON output as dashed lines
- Write TestSyntheticAirportCityEdges and TestRouteWithSyntheticAirportCityEdges tests
2026-08-16 16:05:50 +03:00
3da7f5282c feat: Implement Station Status endpoint (Task 8)
- Implement GET /v1/stations/{id}/status endpoint
- Returns station status (active/closed) based on real scheduled edges
- Add stationStatusResponse, cityResponse, routeSearchResponse, routeGeoJSONResponse types
- Add stub implementations for other API handlers to enable compilation
- Add TestHandlerStationStatus test passing
2026-08-16 15:13:05 +03:00
6ae491ef1c feat: Implement basic caching layer with cache-aside pattern for /search results
- Implement cache-aside pattern via SearchCacheService in RouteSearch handler
- Add TTL policies: 3 hours near-term, 7 days far-term
- Write TestCacheAsideSearch and variants for TTL verification
- Extend CacheAside to fully implement Cache interface (Get, Set, Exists, Delete, Increment, Decrement)
2026-08-16 14:53:33 +03:00
88d27421ce feat: implement MVP routing endpoints and cron station status detection
This commit implements the core routing functionality for the trip planner MVP:

1. API handlers for city autocomplete, station listing, route search, and route GeoJSON
2. Router integration with Yandex Schedules API for building routing graphs
3. Pareto-optimal route search with max 1 transfer and MCT filtering
4. Cron job for station status detection and closure monitoring
5. Circuit breaker and rate limiter integration in Yandex client
6. Redis cache-aside layer for city directories and station lists

Co-Authored-By: Claude <noreply@anthropic.com>
2026-08-14 13:06:29 +03:00
e063d26d4c fix: code correctness, security, and simplicity improvements 2026-08-13 21:23:15 +03:00
2101362d31 feat: complete Task 7 - end-to-end integration and full test suite 2026-08-13 21:01:53 +03:00
1bfe659d2c feat: implement API handlers for MVP endpoints (Task 5)
- Create cmd/api/handlers.go with HTTP handlers for all MVP endpoints
- Implement GET /v1/cities?query= city autocomplete
- Implement GET /v1/cities/{id}/stations city stations including neighbors
- Implement POST /v1/routes/search route search with Pareto-optimal results
- Implement GET /v1/routes/{search_id}/{route_id}/geojson route geometry
- Implement GET /v1/stations/{id}/status station status endpoint
- Add handler tests with success and error cases
- All existing tests pass
2026-08-13 20:26:28 +03:00
e98950585d feat: setup project structure and dependencies - init Go module, add redis/sqlx deps, docker-compose config, basic project scaffold 2026-08-13 18:54:13 +03:00