## Handoff: RTSport Frontend Alignment **What:** Align frontend mocks to backend endpoint structure. The scaffold is live — consume real API shapes instead of static mocks. **Why:** Contract-first collaboration. Backend scaffold complete (Socrates), now frontend needs to align to actual endpoints and response shapes. **Files:** - `/home/hoffmann_admin/.openclaw/shared/build-20260501/SPEC.md` — Integration spec - `/home/hoffmann_admin/.openclaw/shared/build-20260501/docs/contract.md` — Source of truth (v0.2) - `/home/hoffmann_admin/.openclaw/shared/build-20260501/backend/app/schemas.py` — Pydantic schemas (ground truth for JSON shapes) - `/home/hoffmann_admin/.openclaw/shared/build-20260501/backend/app/api/` — Endpoint structure - `/home/hoffmann_admin/.openclaw/shared/build-20260501/frontend/` — Your existing mocks (already cloned from repo) **What Changed (Backend — Done by Socrates + Wadsworth):** | Schema | Key Shape | |--------|-----------| | `SchoolSchema` | `{id, name, domain, config}` | | `AthleteSchema` | `{id, school_id, first_name, last_name, grade, sports, team, current_status, active_case_ids}` | | `CaseSchema` | `{id, school_id, athlete_id, title, severity, attention_level, status, opened_at, resolved_at, reopened_from_case_id, reopened_at, primary_at_id}` | | `MilestoneSchema` | `{id, school_id, case_id, title, target_date, status, achieved_at}` | | `EventSchema` | `{id, school_id, case_id, author_id, event_type, visibility, content, timestamp}` | **Endpoints (All Ready):** | Method | Endpoint | Returns | |--------|----------|---------| | GET | `/api/v1/roster?school_id=&sport=&team=` | `RosterResponse` (list of AthleteSchema) | | GET | `/api/v1/roster/{athlete_id}` | `AthleteSchema` | | GET | `/api/v1/cases/{athlete_id}` | List of `CaseSchema` | | GET | `/api/v1/cases/{case_id}/timeline` | List of `EventSchema` (FERPA-filtered) | | GET | `/api/v1/cases/{case_id}/milestones` | List of `MilestoneSchema` | | POST | `/api/v1/events/sideline-entry` | `SidelineEntryResponse` | **Your Task:** 1. Read the existing frontend mocks in `/home/hoffmann_admin/.openclaw/shared/build-20260501/frontend/` 2. Align your HTMX templates to hit these real endpoints 3. Ensure form fields match `SidelineEntryRequest` shape: ```json { "school_id": "schl_001", "athlete_id": "ath_102938", "body_part": "Ankle - Right", "severity": "moderate", "attention_level": "warning", "removed_from_play": true, "notes": "Optional clinical notes" } ``` 4. Ensure roster display handles `current_status` + `active_case_ids` 5. Ensure case timeline handles `visibility` filtering (FERPA) 6. Update `integration.md` with your progress **Scope:** - ✅ DO: Align templates, forms, HTMX attributes to real endpoints - ✅ DO: Update mock data to match schema shapes - ❌ DON'T: Change backend schemas or endpoints - ❌ DON'T: Implement auth yet (deferred) - ❌ DON'T: Write tests yet **Success Criteria:** - Frontend templates render correctly against backend schemas - HTMX forms POST to correct endpoints with correct payloads - Roster shows `current_status` indicators (cleared/restricted/out) - Case timeline respects visibility (coach sees less than AT) **ETA:** TBD — provide your own after review **Coordination:** - Backend is stable — no breaking changes expected - Update `shared/build-20260501/integration.md` as you work - Questions? Ping Socrates via shared directory or Wadsworth will relay