Add jersey fields to PlayerProfileResponse #257

Closed
opened 2026-03-30 16:07:32 +00:00 by forgejo_admin · 0 comments
Contributor

Type

Feature

Lineage

Related to forgejo_admin/westside-landing#197 (jersey order card on player profile). That ticket needs jersey status visible in the profile response to render the card correctly.

Repo

forgejo_admin/basketball-api

User Story

As a parent viewing my child's profile
I want to see their jersey ordering status
So that I know whether I need to order a jersey or it's already handled

Context

PlayerProfileResponse in routes/players.py currently returns player info (name, height, position, team, parent, etc.) but no jersey fields. The Player model already has jersey_option, jersey_size, jersey_number, and jersey_order_status (verified in models.py lines 208-212). The AdminPlayerItem response already includes these fields (added in PRs #248/#249). This ticket mirrors that for the parent-facing profile endpoint.

File Targets

Files the agent should modify or create:

  • src/basketball_api/routes/players.py -- Add jersey_option, jersey_size, jersey_number, jersey_order_status fields to PlayerProfileResponse (line 40) and map them in _player_profile_response() (line 92)

Files the agent should NOT touch:

  • src/basketball_api/routes/jersey.py -- jersey ordering routes, separate concern
  • src/basketball_api/routes/admin.py -- admin already has these fields

Acceptance Criteria

  • When I GET /api/players/{id}, the response includes jersey_option, jersey_size, jersey_number, and jersey_order_status
  • When a player has no jersey data, fields return null
  • When a player has jersey data, fields return correct values

Test Expectations

  • Unit test: test_player_profile_includes_jersey_fields -- create player with jersey data, verify response includes all 4 fields
  • Unit test: test_player_profile_jersey_fields_null_when_empty -- player without jersey data returns null for all 4
  • Run command: pytest tests/ -k test_player_profile

Constraints

  • Follow existing pattern in PlayerProfileResponse -- add fields at schema level, map in _player_profile_response() helper
  • Mirror field names from AdminPlayerItem for consistency
  • No new dependencies

Checklist

  • PR opened
  • Tests pass
  • No unrelated changes
  • project-westside-basketball
  • forgejo_admin/westside-landing#197 -- frontend consumer of these fields
  • forgejo_admin/basketball-api#248 / #249 -- admin version of same fields
### Type Feature ### Lineage Related to `forgejo_admin/westside-landing#197` (jersey order card on player profile). That ticket needs jersey status visible in the profile response to render the card correctly. ### Repo `forgejo_admin/basketball-api` ### User Story As a parent viewing my child's profile I want to see their jersey ordering status So that I know whether I need to order a jersey or it's already handled ### Context `PlayerProfileResponse` in `routes/players.py` currently returns player info (name, height, position, team, parent, etc.) but no jersey fields. The Player model already has `jersey_option`, `jersey_size`, `jersey_number`, and `jersey_order_status` (verified in models.py lines 208-212). The AdminPlayerItem response already includes these fields (added in PRs #248/#249). This ticket mirrors that for the parent-facing profile endpoint. ### File Targets Files the agent should modify or create: - `src/basketball_api/routes/players.py` -- Add `jersey_option`, `jersey_size`, `jersey_number`, `jersey_order_status` fields to `PlayerProfileResponse` (line 40) and map them in `_player_profile_response()` (line 92) Files the agent should NOT touch: - `src/basketball_api/routes/jersey.py` -- jersey ordering routes, separate concern - `src/basketball_api/routes/admin.py` -- admin already has these fields ### Acceptance Criteria - [ ] When I GET /api/players/{id}, the response includes `jersey_option`, `jersey_size`, `jersey_number`, and `jersey_order_status` - [ ] When a player has no jersey data, fields return null - [ ] When a player has jersey data, fields return correct values ### Test Expectations - [ ] Unit test: `test_player_profile_includes_jersey_fields` -- create player with jersey data, verify response includes all 4 fields - [ ] Unit test: `test_player_profile_jersey_fields_null_when_empty` -- player without jersey data returns null for all 4 - Run command: `pytest tests/ -k test_player_profile` ### Constraints - Follow existing pattern in `PlayerProfileResponse` -- add fields at schema level, map in `_player_profile_response()` helper - Mirror field names from AdminPlayerItem for consistency - No new dependencies ### Checklist - [ ] PR opened - [ ] Tests pass - [ ] No unrelated changes ### Related - `project-westside-basketball` - `forgejo_admin/westside-landing#197` -- frontend consumer of these fields - `forgejo_admin/basketball-api#248` / `#249` -- admin version of same fields
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
ldraney/basketball-api#257
No description provided.