Bug: parent phone missing from /admin/players list endpoint #276
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#276
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
Type
Bug
Lineage
Standalone — discovered during admin CRM audit (2026-04-03). Marcus cannot see parent phone numbers.
Repo
forgejo_admin/basketball-apiWhat Broke
The
GET /admin/playerslist endpoint returnsparent_nameandparent_emailbut omitsparent_phone. The data exists in theparentstable (parents.phonecolumn) — e.g. Sandra Apaisa has phone3852329501— but theAdminPlayerItemresponse model doesn't include it.The CSV export endpoint at line 526 of
admin.pyalready includesparent_phone— the fix pattern is proven in the same file.Repro Steps
GET /admin/players— response for player 111 (Aleiyah Apaisa) showsparent_name: "Sandra Apaisa"andparent_email: "apaisasandra@gmail.com"but noparent_phonefieldSELECT phone FROM parents WHERE id = 100→3852329501Expected Behavior
GET /admin/playersresponse should includeparent_phonefor each player, matchingparents.phonefrom the database join.Environment
File Targets
Files to modify:
src/basketball_api/routes/admin.py— addparent_phone: Optional[str] = NonetoAdminPlayerItemmodel (around line 290-297), and passparent_phone=parent.phonein the constructor whereAdminPlayerIteminstances are builttests/test_admin_spa.py— update test assertions to verifyparent_phoneis present in responseReference: the CSV export at
admin.py:526already doesparent_phone=parent.phone— follow that pattern.Files NOT to touch:
src/basketball_api/routes/players.py— detail endpoint already returns phone (nested asparent.phone), leave as-isAcceptance Criteria
GET /admin/playersresponse includesparent_phonefield for each playerparent_phonevalue matchesparents.phonefrom databaseparent_phoneisnullfor players with no parent phone setpytest tests/test_admin_spa.pyRelated
project-westside-basketballforgejo_admin/westside-landing#203Scope Review: READY
Review note:
review-736-2026-04-03Bug confirmed:
AdminPlayerItemPydantic model (admin.py:290-297) omitsparent_phonewhile the CSV export endpoint already includes it. Fix is a 2-line change + test update. Single file, single repo, well under 5-minute agent limit.IncompletePlayerItemhas the same omission (separate follow-up scope)