## Handoff: RTSport Backend Implementation **What:** Build FastAPI backend from contract.md as source of truth. Implement all Pydantic schemas, API endpoints, and PostgreSQL models. **Why:** Contract-first collaboration. Frontend mocks already align with these shapes — no retcon needed. Socrates cleared for duty. **Files:** - `/home/hoffmann_admin/.openclaw/shared/build-20260501/docs/contract.md` — Source of truth (v0.2) - `/home/hoffmann_admin/.openclaw/shared/build-20260501/SPEC.md` — Integration spec - `/home/hoffmann_admin/.openclaw/shared/build-20260501/backend/` — Write your code here **Contract Summary:** - **5 Pydantic Schemas:** Tenant/School, Athlete, Case, Milestone, Event - **4 GET endpoints:** roster, cases, timeline, milestones - **1 POST endpoint:** sideline-entry (3-tap rapid entry) - **Key constraints:** - `school_id` on every model (multi-tenant) - `severity` (clinical, static) ≠ `attention_level` (operational, daily) - `clearance_granted` event closes case (reopenable within 30 days) - `visibility` defaults `["at"]` — AT must explicitly expand - `clinical_notes` stripped server-side for non-AT roles - `current_status` cached on Athlete — update via DB trigger **Success Criteria:** - All 5 schemas validate correctly with Pydantic v2 - All endpoints return correct shapes per contract - FERPA gate strips clinical_notes for coach/parent roles - current_status updates via DB trigger or transaction hook - PostgreSQL tables with proper indexing on school_id **ETA:** TBD — provide your own after review **Coordination:** - Read `shared/build-20260501/SPEC.md` for integration context - Update `shared/build-20260501/integration.md` with progress - Frontend mocks are already aligned — no breaking changes expected