fix: add division/age_group to public teams, rename school field #213
No reviewers
Labels
No labels
domain:backend
domain:devops
domain:frontend
status:approved
status:in-progress
status:needs-fix
status:qa
type:bug
type:devops
type:feature
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
forgejo_admin/basketball-api!213
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "211-public-teams-add-division-fix-school"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
PublicTeamResponse was missing
divisionandage_groupfields needed by the westside-app frontend for Kings/Queens filtering. Also renamedcurrent_schooltoschoolin PublicPlayerResponse to match what the frontend reads.Changes
src/basketball_api/routes/public.py:division: str | Noneandage_group: str | NonetoPublicTeamResponseteam.division.valueandteam.age_group.valuewhen constructing the responsecurrent_schooltoschoolinPublicPlayerResponse_public_player()helper to mapplayer.current_schooltoschooltests/test_public.py:allowed_keysassertions for both team and player field setscurrent_schoolassertion toschoolTest Plan
pytest tests/test_public.py -v-- 21/21 passruff check .-- all checks passeddivisionandage_groupper teamschoolfield name (notcurrent_school)Review Checklist
current_schoolrenamed toschool-- westside-app already readsschool, so this is the fix not the breakRelated
Related Notes
N/A -- no pal-e-docs notes associated with this bug fix.
QA Review -- PR #213
Diff Summary
2 files changed, +9/-5. Minimal, focused fix.
Findings
Schema changes (public.py)
PublicPlayerResponse.current_schoolrenamed toschool-- maps correctly fromplayer.current_schoolin_public_player(). No data loss.PublicTeamResponsegainsdivision: str | Noneandage_group: str | None-- both use.valueenum extraction with proper null guards (if team.division else None). Correct pattern matching existingage_groupusage in_team_sort_key.str | None, not enum types -- correct for a public JSON API response.Test changes (test_public.py)
allowed_keysupdated for both player and team field sets -- matches new schema exactly.current_schoolassertion updated toschool-- matches the rename.Nits: None.
Concerns: None. The
current_school->schoolrename is a breaking change for any consumer readingcurrent_school, but the PR body correctly notes westside-app already readsschool, making this the fix not the break.VERDICT: APPROVED