Add jersey order card to player profile page #197

Closed
opened 2026-03-29 23:11:46 +00:00 by forgejo_admin · 0 comments
Contributor

Type

Feature

Lineage

Child of forgejo_admin/westside-landing#196 (spike: player self-service jersey ordering).
Depends on: backend dual-auth + player_id param tickets (basketball-api).
Story: WS-S18

Repo

forgejo_admin/westside-landing

User Story

As a logged-in parent viewing my player's profile
I want to see a jersey ordering card with current status or an order button
So that I can order a jersey directly from my player's profile

Context

The player profile page (players/[id]/+page.svelte) has cards for contract, player info, team/coach, payment, and stats — but no jersey section. Jersey ordering is only accessible via the email token link (/jersey?token=...).

The backend PlayerProfileResponse in players.py does not currently include jersey fields (jersey_option, jersey_order_status, jersey_size, jersey_number), even though they exist on the Player model. The frontend needs these fields to render jersey status.

File Targets

Files the agent should modify or create:

  • src/routes/(app)/players/[id]/+page.svelte — add jersey card section between team/coach card (line ~495) and payment card (line ~498); show status if ordered, "Order Jersey" CTA if not
  • Backend dependency: PlayerProfileResponse in basketball-api/src/basketball_api/routes/players.py needs jersey fields added (this may be a separate micro-ticket or done inline)

Files the agent should NOT touch:

  • src/routes/(app)/jersey/+page.svelte — separate ticket handles session auth there
  • src/routes/(app)/checkout/+page.svelte — separate ticket

Acceptance Criteria

  • When I view a player profile with jersey_order_status === 'none', then I see an "Order Jersey" button
  • When I click "Order Jersey", then I navigate to /jersey?player_id={player.id}
  • When I view a player with jersey_order_status === 'paid', then I see the jersey option, size, and number displayed
  • When I view as a coach (not owner or admin), then the jersey card is hidden
  • When I view as unauthenticated, then the jersey card is hidden

Test Expectations

  • Manual test: verify jersey card renders on player profile
  • Manual test: verify button navigates with correct player_id
  • Manual test: verify status display for ordered jerseys
  • Run command: npm run build (SvelteKit build check)

Constraints

  • Match existing card style (.info-card pattern used by other cards on the page)
  • Only visible to isOwner or isAdmin (same permission model as payment card)
  • Backend must expose jersey fields in PlayerProfileResponse first

Checklist

  • PR opened
  • Tests pass
  • No unrelated changes
  • westside-basketball — project this affects
  • forgejo_admin/westside-landing#196 — parent spike issue
### Type Feature ### Lineage Child of `forgejo_admin/westside-landing#196` (spike: player self-service jersey ordering). Depends on: backend dual-auth + player_id param tickets (basketball-api). Story: WS-S18 ### Repo `forgejo_admin/westside-landing` ### User Story As a logged-in parent viewing my player's profile I want to see a jersey ordering card with current status or an order button So that I can order a jersey directly from my player's profile ### Context The player profile page (`players/[id]/+page.svelte`) has cards for contract, player info, team/coach, payment, and stats — but no jersey section. Jersey ordering is only accessible via the email token link (`/jersey?token=...`). The backend `PlayerProfileResponse` in `players.py` does not currently include jersey fields (`jersey_option`, `jersey_order_status`, `jersey_size`, `jersey_number`), even though they exist on the Player model. The frontend needs these fields to render jersey status. ### File Targets Files the agent should modify or create: - `src/routes/(app)/players/[id]/+page.svelte` — add jersey card section between team/coach card (line ~495) and payment card (line ~498); show status if ordered, "Order Jersey" CTA if not - Backend dependency: `PlayerProfileResponse` in `basketball-api/src/basketball_api/routes/players.py` needs jersey fields added (this may be a separate micro-ticket or done inline) Files the agent should NOT touch: - `src/routes/(app)/jersey/+page.svelte` — separate ticket handles session auth there - `src/routes/(app)/checkout/+page.svelte` — separate ticket ### Acceptance Criteria - [ ] When I view a player profile with `jersey_order_status === 'none'`, then I see an "Order Jersey" button - [ ] When I click "Order Jersey", then I navigate to `/jersey?player_id={player.id}` - [ ] When I view a player with `jersey_order_status === 'paid'`, then I see the jersey option, size, and number displayed - [ ] When I view as a coach (not owner or admin), then the jersey card is hidden - [ ] When I view as unauthenticated, then the jersey card is hidden ### Test Expectations - [ ] Manual test: verify jersey card renders on player profile - [ ] Manual test: verify button navigates with correct player_id - [ ] Manual test: verify status display for ordered jerseys - Run command: `npm run build` (SvelteKit build check) ### Constraints - Match existing card style (`.info-card` pattern used by other cards on the page) - Only visible to `isOwner` or `isAdmin` (same permission model as payment card) - Backend must expose jersey fields in `PlayerProfileResponse` first ### Checklist - [ ] PR opened - [ ] Tests pass - [ ] No unrelated changes ### Related - `westside-basketball` — project this affects - `forgejo_admin/westside-landing#196` — parent spike issue
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/westside-app#197
No description provided.