feat: add jersey payment status badges to admin CRM #193
No reviewers
Labels
No labels
domain:backend
domain:devops
domain:frontend
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
ldraney/westside-app!193
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "183-crm-jersey-badges"
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
Adds jersey order status badges to the admin CRM player list. Each player card now shows their jersey payment state as a colored badge, and paid/shipped players display their jersey option and number in the detail line.
Changes
src/routes/(app)/admin/players/+page.svelte-- addedgetJerseyBadgeClass(),getJerseyLabel(), andgetJerseyOptionLabel()helper functions following the existing contract badge pattern; added jersey badge to card-row-name-line; added jersey option/number to card-row-detail for paid/shipped playerssrc/app.css-- added four new badge classes:badge-jersey-none(grey),badge-jersey-pending(yellow),badge-jersey-paid(green),badge-jersey-shipped(blue)Test Plan
svelte-check: 0 errors, no new warningsReview Checklist
Related Notes
forgejo_admin/basketball-api#248PR #193 Review
DOMAIN REVIEW
Tech stack: SvelteKit (Svelte 5 runes), vanilla CSS with design tokens.
Pattern compliance: The PR adds three helper functions (
getJerseyBadgeClass,getJerseyLabel,getJerseyOptionLabel) that exactly mirror the existinggetContractBadgeClass/getContractLabelpattern. Switch/case structure, JSDoc param types, default fallbacks -- all consistent with the established code at lines 41-76 of the players page.CSS classes: Four new
badge-jersey-*classes added atsrc/app.cssline 1381+, placed directly after the existing contract badge block. All four use existing design token variables (--color-gray-800,--color-yellow-bg,--color-green-bg,--color-blue-bg, etc.), which are all defined in the:rootblock (lines 32-34 for blue tokens, verified).Badge color spec verification:
badge-jersey-none= grey (gray-800/gray-400/gray-600) -- MATCHES specbadge-jersey-pending= yellow (yellow-bg/yellow/yellow-border) -- MATCHES specbadge-jersey-paid= green (green-bg/green/green-border) -- MATCHES specbadge-jersey-shipped= blue (blue-bg/blue/blue-border) -- MATCHES specMobile handling: The
card-row-name-linecontainer (app.css line 1544) usesdisplay: flex; flex-wrap: wrap; gap: 0.5rem, so the third badge will naturally wrap on narrow viewports. No additional responsive CSS needed.Detail line logic: Jersey option and number only render when
jersey_order_status === 'paid' || 'shipped'-- correctly guarded with nested{#if}blocks for bothgetJerseyOptionLabel()truthiness andplayer.jersey_numberexistence.Scope: Exactly 2 files changed (players page + app.css), 36 additions, 1 deletion (the modified detail line). No unrelated changes detected.
BLOCKERS
None.
This is a frontend-only display change with no user input handling, no auth/security paths, no backend changes, and no new functionality requiring test coverage (display-only badge rendering following an established untested pattern in the same file). The existing badge helpers (
getStatusBadgeClass,getContractBadgeClass) are also untested -- adding test requirements here would be scope creep beyond the existing codebase conventions.NITS
CSS duplication (non-blocking, intentional): The four new
badge-jersey-*classes are value-identical to existing classes (badge-jersey-none=badge-no-contract,badge-jersey-pending=badge-offered,badge-jersey-paid=badge-signed,badge-jersey-shipped=badge-division). This follows the established pattern of semantic class naming per domain, which allows independent color changes later. Not a DRY violation -- it is the convention. Noting for awareness only.Middot character inconsistency (cosmetic): The existing detail line uses
\u00B7in JS template expressions, while the new jersey section uses·HTML entity. Both render identically. The difference is because existing separators are in JS expression context ({player.division ? ' \u00B7 ' + ...}) while the new ones are in Svelte template context ({#if ...} · ...). Functionally correct, just a different encoding of the same character.Long template line: The
card-row-detaildiv content is now a single very long line (~300+ chars). Readability could be improved by breaking across lines, but this matches the existing style in the file (the original line was already long). Non-blocking.SOP COMPLIANCE
183-crm-jersey-badgesfollows{issue-number}-{kebab-case-purpose}conventionCloses #183and notes backend dependencybasketball-api#248feat: add jersey payment status badges to admin CRMfollows conventional commitsPROCESS OBSERVATIONS
Clean, minimal PR. 36 lines added across 2 files for a display-only feature. The pattern reuse (copying the contract badge approach) keeps cognitive load low. Backend dependency on
basketball-api#248is noted in the PR body -- thejersey_order_status,jersey_option, andjersey_numberfields must exist on the player API response for these badges to render meaningful data (they will gracefully fall back to "No Jersey" / empty if the fields are absent).VERDICT: APPROVED