# 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`.
