docs: mark Task 4 complete in MVP plan

This commit is contained in:
2026-08-13 20:13:58 +03:00
parent 39f20bff4f
commit 32e7cef4d5

View File

@@ -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