Premier League Predictor: Astro — Chapter 9, Exercise 3 ==================================================== TASK Set up a complete 20-team season with a full league table, call GET /api/seasons/{seasonId}/relegation-preview to confirm the correct bottom three, then call POST /api/seasons/{seasonId}/rollover against a newly created next season and confirm the new season's season_teams contains exactly the 17 survivors — followed by three calls to Chapter 3's own POST /api/seasons/{id}/teams route to add three promoted clubs, bringing the new season back up to 20. SOLUTION Steps to complete the hands-on part: 1. Using Chapters 2-4, create a season ("2026/27"), add 20 real teams to it, create 38 gameweeks' worth of fixtures (or a smaller representative set, so long as every team has at least one played fixture and the table has no genuinely tied positions right at the 17/18 boundary, to keep the bottom-three cutoff unambiguous), and enter real results for all of them via Chapter 6's own PATCH /api/fixtures/{id}/result route. 2. Call GET /api/seasons/{seasonId}/table (Chapter 7) and note the bottom three teams by name. 3. Call GET /api/seasons/{seasonId}/relegation-preview. Confirm its own "relegated" array lists exactly those same three teams, in the same order, and its "survivors" array lists the other 17. 4. Create a new season, "2027/28", via POST /api/seasons. 5. Call POST /api/seasons/{oldSeasonId}/rollover with { "new_season_id": <2027/28's id> }. 6. Query season_teams directly for the new season: SELECT t.name FROM season_teams st JOIN teams t ON t.id = st.team_id WHERE st.season_id = <2027/28's id>; Confirm this returns exactly the 17 survivor names from Step 3 — no more, no fewer, and none of the three relegated teams present. 7. Call POST /api/seasons/{2027/28 id}/teams three times, once per promoted club, e.g.: { "team_name": "Leeds United", "short_name": "Leeds" } { "team_name": "Sunderland", "short_name": "Sunderland" } { "team_name": "Sheffield United", "short_name": "Sheff Utd" } 8. Re-run the same SELECT from Step 6. Confirm the new season now has exactly 20 teams: the original 17 survivors plus the three promoted clubs just added. Confirm one more detail directly: the three relegated teams' own season_teams rows for the OLD season are still present and unchanged — querying season_teams for the old season_id should still return all 20 original teams, proving relegation never deleted anything from the old season's own historical record. WHY THIS WORKS AS AN ANSWER ---------------------------- It completes the real, hands-on setup for a full season and confirms every step of the chapter's own real workflow against actual data: the relegation preview matching the league table's own bottom three exactly, the rollover producing precisely 17 new rows with none of the relegated teams present, the three promoted teams correctly bringing the new season back to a full 20 via Chapter 3's own unmodified route, and — the detail most worth explicitly checking — confirmation that the old season's own season_teams rows are entirely untouched, proving relegation really is an omission from the new season rather than a deletion from the old one.