plan/react-rewrite #1
@@ -0,0 +1,67 @@
|
||||
# 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:
|
||||
1. Simple: `schedule/{flight1-date}/{flight2-date}/...`
|
||||
2. 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 parameters
|
||||
- `IScheduleDetailsParams` -- multi-flight details parameters
|
||||
- `IScheduleResponse` -- `IFlight[]` (reuses online-board flight types)
|
||||
- `IScheduleDetailsResponse` -- same as `IBoardResponse`
|
||||
- `IScheduleCalendarParams` -- calendar day availability
|
||||
|
||||
## Execution order
|
||||
|
||||
3A -> 3B -> 3C -> 3D -> 3E (sequential, each builds on prior)
|
||||
|
||||
## Constraints
|
||||
|
||||
- Do NOT modify `ClientApp/`, ASP.NET, or `wwwroot/`.
|
||||
- Update `src/features/schedule/index.ts` barrel.
|
||||
- Update `src/mf/expose/Schedule.tsx` from stub to real component.
|
||||
- Final verification: `pnpm typecheck && pnpm lint && pnpm test && pnpm build:standalone`.
|
||||
@@ -0,0 +1,29 @@
|
||||
# Phase 3A -- Schedule URL Serializer/Parser
|
||||
|
||||
> **Parent:** `2026-04-15-phase-3-schedule-master.md`
|
||||
> **Depends on:** Phase 2B (reuses parseFlightUrlParams, buildFlightUrlParams)
|
||||
|
||||
## Goal
|
||||
|
||||
TDD implementation of URL parser/builder for the schedule feature covering:
|
||||
1. Start page
|
||||
2. One-way route search
|
||||
3. Round-trip route search
|
||||
4. Multi-flight details (catch-all)
|
||||
|
||||
## Deliverables
|
||||
|
||||
1. `src/features/schedule/types.ts` -- schedule-specific types
|
||||
2. `src/features/schedule/url.ts` -- parse/build functions
|
||||
3. `src/features/schedule/url.test.ts` -- comprehensive tests
|
||||
|
||||
## URL Format Reference
|
||||
|
||||
### Route params: `{dep}-{arr}-{dateFrom}-{dateTo}[-{timeFromTo}][-C{connections}]`
|
||||
### Details: `{flight1-date}[/{flight2-date}]...` or with airport codes interleaved
|
||||
|
||||
## Tasks
|
||||
|
||||
T1. Create schedule types
|
||||
T2. Write URL test file (TDD -- tests first)
|
||||
T3. Implement url.ts to pass all tests
|
||||
Reference in New Issue
Block a user