2.2 KiB
2.2 KiB
Phase 3 -- Schedule Feature (Master Plan)
Parent: React rewrite project Depends on: Phase 1 (foundation), Phase 2 (online board -- patterns to reuse)
Overview
Port the Angular Schedule feature to the React codebase. The schedule is structurally similar to the online board but differs in several key ways:
- Date ranges (dateFrom/dateTo) instead of single dates.
- Round-trip search with outbound + return param segments.
- Catch-all details route for variable-length multi-flight chains.
- POST for search (not GET).
- No SignalR -- schedule data is static.
- Connections filter (C0, C1, ...) in URL params.
URL Format
Search (route)
schedule/route/{dep}-{arr}-{dateFrom}-{dateTo}[-{timeFromTo}][-C{connections}]
Round-trip search
schedule/route/{outbound-params}/{return-params}
Details (catch-all)
Two formats coexist:
- Simple:
schedule/{flight1-date}/{flight2-date}/... - With airports:
schedule/{depCode}/{flight1-date}/{arrCode}/{depCode2}/{flight2-date}/{arrCode2}/...
Start page
schedule
Sub-plans
| Sub-plan | Name | Deliverables |
|---|---|---|
| 3A | URL serializer/parser | src/features/schedule/url.ts + tests |
| 3B | API + hooks | api.ts, useScheduleSearch, useScheduleDetails, useScheduleCalendar |
| 3C | Route pages | 4 Modern.js route pages |
| 3D | SEO + JSON-LD | seo.ts, json-ld.ts + tests |
| 3E | Parity + integration | Parity harness registration, ~10 integration tests |
Key types (new in src/features/schedule/types.ts)
IScheduleSearchParams-- outbound search parametersIScheduleDetailsParams-- multi-flight details parametersIScheduleResponse--IFlight[](reuses online-board flight types)IScheduleDetailsResponse-- same asIBoardResponseIScheduleCalendarParams-- calendar day availability
Execution order
3A -> 3B -> 3C -> 3D -> 3E (sequential, each builds on prior)
Constraints
- Do NOT modify
ClientApp/, ASP.NET, orwwwroot/. - Update
src/features/schedule/index.tsbarrel. - Update
src/mf/expose/Schedule.tsxfrom stub to real component. - Final verification:
pnpm typecheck && pnpm lint && pnpm test && pnpm build:standalone.