Premier League Predictor: FastAPI & PostgreSQL — Chapter 9, Exercise 3 ==================================================== TASK Complete a full real season (enter results for all fixtures needed to give every team a real record), call the relegation preview, create a new season, and roll it over with three real promoted team names — then confirm the new season's roster has exactly 20 teams: 17 real survivors plus the 3 promoted teams. SOLUTION Steps to complete this exercise, using season_id 1 as the completed old season: 1. Ensure season 1 has a real, played result entered (via PATCH /api/fixtures/{id}/result, Chapter 6) for enough fixtures that every one of its 20 SeasonTeam-registered teams has at least one real result on record, so GET /api/seasons/1/table returns a genuinely ranked table rather than a set of all-zero rows. 2. Call GET /api/seasons/1/relegation-preview and note the three team names it returns — these are the real bottom three by the actual standings. 3. Create a new, empty season: POST /api/seasons {"name": "2027/28", "start_date": "2027-08-01", "end_date": "2028-05-31", "is_current": true} Note its returned id (season_id 2, for this example). 4. Roll season 1 over into season 2 with three real promoted team names: POST /api/seasons/2/rollover-from/1 {"promoted_teams": [ {"team_name": "Leicester City", "short_name": "Leicester"}, {"team_name": "Leeds United", "short_name": "Leeds"}, {"team_name": "Southampton", "short_name": "Southampton"} ]} 5. Confirm the response is a list of exactly 20 Team objects. 6. Cross-check: none of the three team names returned by the relegation preview in step 2 should appear in the roster returned in step 5 — confirming they were genuinely excluded, not accidentally carried over. All three of the promoted team names from step 4 should appear in the roster, confirming they were correctly added. One-sentence confirmation: the new season's roster contains exactly 20 teams — the 17 real survivors from season 1, correctly excluding the three relegated teams identified by the preview, plus the 3 newly promoted teams entered by name. WHY THIS WORKS AS AN ANSWER ---------------------------- It walks through the complete real workflow end to end (playing out a season, previewing relegation, creating an empty new season, rolling it over), and closes with a real, verifiable cross-check confirming both halves of the rule at once — the relegated three are genuinely absent, and the promoted three are genuinely present — rather than only checking the total count of 20.