Review: Admin player dashboard -- player list and player detail pages
Verdict: NEEDS_REFINEMENT
Template Completeness
- [x] Type -- Feature
- [x] Lineage
- [x] Repo
- [x] User Story
- [x] Context
- [x] File Targets (create, modify, don't-touch sections)
- [x] Feature Flag (none, with justification)
- [x] Acceptance Criteria
- [x] Test Expectations
- [x] Constraints
- [x] Checklist
- [x] Related
Traceability
- [ ] story:WS-S7 label -- MISMATCH. WS-S7 on project-westside-basketball says "As an admin, I want to send branded email announcements so that parent comms are professional and consistent." This ticket is about a player dashboard showing payment status. The issue body user story ("see at a glance who owes what without digging through Stripe manually") maps to
story:WS-S9("As an admin, I want to track payment status per player so that I know who owes what"). [LABEL] Change story label fromstory:WS-S7tostory:WS-S9. - [x] story note verified -- WS-S9 exists in project-westside-basketball user-stories section under Admin (Marcus)
- [ ] arch:rails-views label -- no
arch-rails-viewsnote found in pal-e-docs. [SCOPE] Create architecture notearch-rails-viewsfor the Rails views component. - [x] Forgejo issue -- ldraney/westside-basketball#55, state: open
File Targets
- [x]
app/controllers/admin/players_controller.rb-- to create. Directoryapp/controllers/admin/exists withpayments_controller.rbandroster_report_controller.rbas reference patterns. Verified. - [x]
app/views/admin/players/index.html.erb-- to create. Parent directoryapp/views/admin/exists withpayments/androster_report/subdirectories. Verified. - [x]
app/views/admin/players/show.html.erb-- to create. Same parent directory. Verified. - [x]
config/routes.rb-- to modify. File exists. NOTE: Current routes already haveresources :players, only: []in the admin namespace (used as nesting for the monthly_fee member route). The agent must expand this existing resource declaration to include[:index, :show]rather than adding a duplicate. [BODY] Add a note in File Targets: "Expand existingresources :players, only: []to include[:index, :show]-- do not add a duplicate resource block." - [x]
app/controllers/admin/payments_controller.rb-- don't touch. Verified exists. - [x]
app/controllers/admin/roster_report_controller.rb-- don't touch. Verified exists. - [x]
db/schema.rb-- don't touch. Verified exists.
Data Model Verification
- [x]
playerstable -- exists, hassubscription_statusenum andjersey_order_statusenum as referenced in AC - [x]
parentstable -- exists, hasname,email,phonecolumns as needed for detail page - [x]
productstable -- exists withcategoryenum (jersey, contract, tournament, equipment, monthly) - [x]
orderstable -- exists - [x]
payment_linkstable -- exists - [x]
email_logtable -- exists withemail_typeenum includingpayment_requestvalue andplayer_idFK - [x] Player model has associations:
belongs_to :parent,has_many :teams through :player_teams,has_many :orders,has_many :payment_links,has_many :email_logs - [x] No migrations needed claim verified -- all tables and columns exist
Repo Placement
OK -- issue filed on ldraney/westside-basketball, all file targets are in the same repo. Single-repo change.
Dependencies
depends:54(board item #1605) -- "Add Keycloak auth with admin/parent/player roles" -- currently in backlog, state: open. This is correctly documented in the issue body ("depends on #54 landing first").- AC item "Admin role required (depends on #54 landing first)" correctly acknowledges the dependency, but auth does not exist yet. The controller can be built without auth (matching existing admin controllers which also have no auth), and auth can be layered on after #54 lands.
- Test expectation "unauthenticated user redirected to login (after #54)" is correctly deferred.
Acceptance Criteria
11 AC items + 3 test expectations = 14 checkable items. Most are agent-verifiable via controller tests and view inspection. Concerns:
- "Mobile-responsive" (AC #10) -- hard to verify via automated tests; relies on CSS patterns. Landscaping-assistant reference style is mentioned in constraints but no specific CSS framework or breakpoint targets are given. This is acceptable for a feature ticket if the implementing agent follows responsive patterns.
- "Outstanding balance" (AC #8) -- no formula specified. The existing
payments_controller.rbuses a hardcoded552.0expected amount per player. The ticket should clarify how outstanding balance is calculated (sum of unpaid orders? difference from expected total?). [BODY] Add clarification to AC #8: specify outstanding balance calculation method.
Blast Radius
- Existing
/admin/paymentsand/admin/roster_reportpages query similar data. The issue correctly notes these are kept as-is ("may deprecate later"). - The existing admin namespace route block has a
resources :players, only: []that must be expanded, not duplicated. - There is also a top-level
resources :players, only: [:index]route (non-admin). No conflict, but the agent should be aware. - No auth exists on any admin controller currently. No blast radius from adding new unprotected admin routes (existing pattern).
Decomposition Assessment
NEEDS DECOMPOSITION -- 11 acceptance criteria across 2 pages (list + detail) with distinct UI concerns. Exceeds the 5 AC threshold. The work naturally splits into:
- Sub-ticket A: Player list page -- controller index action, index view, routes, list-specific tests (ACs 1-4, 10)
- Sub-ticket B: Player detail page -- controller show action, show view, detail-specific tests (ACs 5-9, 10)
Estimated agent work: 8-12 minutes as a single ticket; 4-6 minutes each if split. Route to
skill-decompose-ticket.Recommendation
[LABEL]Change story label fromstory:WS-S7tostory:WS-S9-- the user story is about payment tracking, not email announcements.[SCOPE]Create architecture notearch-rails-viewsfor the Rails views component.[BODY]Add route clarification to File Targets: "Expand existingresources :players, only: []to include[:index, :show]-- do not add a duplicate resource block."[BODY]Add outstanding balance calculation method to AC #8.[DECOMPOSE]11 AC across 2 distinct pages, exceeds 5 AC threshold. Route toskill-decompose-ticketwith sub-tickets: (A) player list page, (B) player detail page.