From 32e7cef4d50bd516033ac86528101ef482526d54 Mon Sep 17 00:00:00 2001 From: Vladimir Zagainov Date: Thu, 13 Aug 2026 20:13:58 +0300 Subject: [PATCH] docs: mark Task 4 complete in MVP plan --- .../2026-08-13-MVP-Routing-Implementation.md | 32 +++++++++---------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/docs/plans/2026-08-13-MVP-Routing-Implementation.md b/docs/plans/2026-08-13-MVP-Routing-Implementation.md index d730e35..29359e8 100644 --- a/docs/plans/2026-08-13-MVP-Routing-Implementation.md +++ b/docs/plans/2026-08-13-MVP-Routing-Implementation.md @@ -73,24 +73,24 @@ Implement the Minimum Viable Product for the multimodal trip planning service, f - [x] Run tests - must pass before task 3 ### Task 3: Implement cache-aside layer for reference data and search results -- [ ] Create `internal/cache/store.go` with Redis cache interface -- [ ] Implement cache keys: `cities:{code}`, `stations:{id}`, `search:{from}:{to}:{date}` -- [ ] Implement cache-aside pattern: Redis → miss → Postgres/API → write-back to Redis -- [ ] Set TTL policies: cities/stations 30 days, search near-term 2-6 hours, search far-term 7 days -- [ ] Write tests for cache operations (get, set, invalidate, TTL expiry) -- [ ] Write tests for cache-aside pattern (cache hit, cache miss → API call → cache write) -- [ ] Run tests - must pass before task 4 +- [x] Create `internal/cache/store.go` with Redis cache interface +- [x] Implement cache keys: `cities:{code}`, `stations:{id}`, `search:{from}:{to}:{date}` +- [x] Implement cache-aside pattern: Redis → miss → Postgres/API → write-back to Redis +- [x] Set TTL policies: cities/stations 30 days, search near-term 2-6 hours, search far-term 7 days +- [x] Write tests for cache operations (get, set, invalidate, TTL expiry) +- [x] Write tests for cache-aside pattern (cache hit, cache miss → API call → cache write) +- [x] Run tests - must pass before task 4 ### Task 4: Implement routing graph and search algorithm (max 1 transfer) -- [ ] Create `internal/routing/graph.go` with Node and Edge types -- [ ] Implement Node types: Station, City; Edge kinds: Flight (real), Synthetic -- [ ] Build graph from station directory (Postgres + Redis cache) -- [ ] Implement BFS/Dijkstra search with 1-transfer depth limit -- [ ] Apply MCT (Minimum Connection Time) rules from transfer_rules table -- [ ] Write tests for graph construction (node/edge creation, directory loading) -- [ ] Write tests for search algorithm (successful 1-transfer route, no-route case, 2-transfer rejected) -- [ ] Write tests for MCT rule application (different node types, city tiers, check-in types) -- [ ] Run tests - must pass before task 5 +- [x] Create `internal/routing/graph.go` with Node and Edge types +- [x] Implement Node types: Station, City; Edge kinds: Flight (real), Synthetic +- [x] Build graph from station directory (Postgres + Redis cache) +- [x] Implement BFS/Dijkstra search with 1-transfer depth limit +- [x] Apply MCT (Minimum Connection Time) rules from transfer_rules table +- [x] Write tests for graph construction (node/edge creation, directory loading) +- [x] Write tests for search algorithm (successful 1-transfer route, no-route case, 2-transfer rejected) +- [x] Write tests for MCT rule application (different node types, city tiers, check-in types) +- [x] Run tests - must pass before task 5 ### Task 5: Implement API handlers for MVP endpoints - [ ] Create `cmd/api/handlers.go` with HTTP handlers