Add jersey fields to AdminPlayerItem response #248

Closed
opened 2026-03-29 19:55:30 +00:00 by forgejo_admin · 1 comment
Contributor

Type

Feature

Lineage

Decomposed from forgejo_admin/westside-landing#183. Backend blocker — CRM can't display jersey data until the API returns it.

Repo

forgejo_admin/basketball-api

User Story

As Marcus (admin)
I want the admin players API to return jersey fields
So that the CRM frontend can display who ordered jerseys

Context

The Player model has jersey_option, jersey_size, jersey_number, and jersey_order_status fields, but the AdminPlayerItem response model in GET /admin/players does not serialize them. The CRM frontend has nothing to display. This is a ~5-line addition to the response model + query.

File Targets

Files the agent should modify:

  • src/basketball_api/routes/admin.py — add 4 jersey fields to AdminPlayerItem Pydantic model and populate them in the query

Files the agent should NOT touch:

  • src/basketball_api/models.py — fields already exist on the model
  • src/basketball_api/routes/jersey.py — jersey ordering flow
  • src/basketball_api/routes/checkout.py — checkout flow

Acceptance Criteria

  • GET /admin/players response includes jersey_option (string or null)
  • GET /admin/players response includes jersey_size (string or null)
  • GET /admin/players response includes jersey_number (string or null)
  • GET /admin/players response includes jersey_order_status (string: none/pending/paid/shipped)
  • Existing admin endpoint behavior unchanged for other fields

Test Expectations

  • Unit test: admin players response includes jersey fields
  • Unit test: jersey fields reflect correct values from player record
  • Run command: pytest tests/test_admin_spa.py -v

Constraints

  • Match existing AdminPlayerItem patterns (enum values serialized as strings)
  • Do not change the Player model or migrations

Checklist

  • PR opened
  • Tests pass
  • No unrelated changes
  • project-westside-basketball
  • forgejo_admin/westside-landing#183 — CRM frontend (depends on this)
### Type Feature ### Lineage Decomposed from `forgejo_admin/westside-landing#183`. Backend blocker — CRM can't display jersey data until the API returns it. ### Repo `forgejo_admin/basketball-api` ### User Story As Marcus (admin) I want the admin players API to return jersey fields So that the CRM frontend can display who ordered jerseys ### Context The `Player` model has `jersey_option`, `jersey_size`, `jersey_number`, and `jersey_order_status` fields, but the `AdminPlayerItem` response model in `GET /admin/players` does not serialize them. The CRM frontend has nothing to display. This is a ~5-line addition to the response model + query. ### File Targets Files the agent should modify: - `src/basketball_api/routes/admin.py` — add 4 jersey fields to `AdminPlayerItem` Pydantic model and populate them in the query Files the agent should NOT touch: - `src/basketball_api/models.py` — fields already exist on the model - `src/basketball_api/routes/jersey.py` — jersey ordering flow - `src/basketball_api/routes/checkout.py` — checkout flow ### Acceptance Criteria - [ ] `GET /admin/players` response includes `jersey_option` (string or null) - [ ] `GET /admin/players` response includes `jersey_size` (string or null) - [ ] `GET /admin/players` response includes `jersey_number` (string or null) - [ ] `GET /admin/players` response includes `jersey_order_status` (string: none/pending/paid/shipped) - [ ] Existing admin endpoint behavior unchanged for other fields ### Test Expectations - [ ] Unit test: admin players response includes jersey fields - [ ] Unit test: jersey fields reflect correct values from player record - Run command: `pytest tests/test_admin_spa.py -v` ### Constraints - Match existing AdminPlayerItem patterns (enum values serialized as strings) - Do not change the Player model or migrations ### Checklist - [ ] PR opened - [ ] Tests pass - [ ] No unrelated changes ### Related - `project-westside-basketball` - `forgejo_admin/westside-landing#183` — CRM frontend (depends on this)
Author
Contributor

Scope Review: READY

Review note: review-675-2026-03-29
Ticket is well-scoped, traceable, and executable in a single agent pass (~2 min).

One fix needed before dispatch:

  • [BODY] Test run command should be pytest tests/test_admin_spa.py -v (not tests/test_admin.py). test_admin.py covers token generation, not /admin/players.

Non-blocking discovered scope:

  • [SCOPE] Create architecture note arch-basketball-api (pre-existing gap, not a blocker).
## Scope Review: READY Review note: `review-675-2026-03-29` Ticket is well-scoped, traceable, and executable in a single agent pass (~2 min). **One fix needed before dispatch:** - [BODY] Test run command should be `pytest tests/test_admin_spa.py -v` (not `tests/test_admin.py`). test_admin.py covers token generation, not /admin/players. **Non-blocking discovered scope:** - [SCOPE] Create architecture note `arch-basketball-api` (pre-existing gap, not a blocker).
forgejo_admin 2026-03-29 20:07:17 +00:00
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#248
No description provided.