Fix: align contract page with approved playground — proration, local schedules, remove local conduct rules #17

Closed
opened 2026-03-24 20:54:17 +00:00 by forgejo_admin · 1 comment

Type

Bug

Lineage

plan-wkq → Phase 14 (Billing Tiers & Contracts) — drift from approved playground prototype

Repo

forgejo_admin/westside-contracts

What Broke

The deployed contract page drifted from the Marcus-approved playground prototype (pal-e-playground branch 5-sync-westside-contract-html-with-deploye). Three discrepancies:

1. Proration label missing (both travel and local)

  • Playground: First monthly fee — prorated ($165)
  • Deployed: First monthly fee (${monthlyFee}) — shows full fee, no "prorated" label
  • Fix: Show First monthly fee — prorated ($X) where X is calculated dynamically: Math.round(monthlyFee * 25 / 30 / 5) * 5. The proratedFee calculation existed in the original code but was removed during date cleanup.

2. Local practice schedules missing

  • Playground (lines 1050-1058): Team-specific schedules — Monday BWill 7-9 PM, Tuesday West High 6-8 PM
  • Deployed (line 356): Generic "Practice days and locations vary by team"
  • Fix: Restore team-specific schedules using player.team_name conditional. The original scaffold had these but they were replaced with placeholder text.
    • 17U Local: Monday BWill 7-9 PM, Tuesday West High Field House 6-8 PM
    • 16U Local: Monday BWill 7-9 PM, Friday BWill 7-9 PM

3. Rules of Conduct on local contract — should not be there

  • Playground: NO rules of conduct on local contract (only on travel)
  • Deployed (lines 383-388): Has rules of conduct section
  • Fix: Remove the <h3>Rules of Conduct</h3> and <ul> block from the local contract section

Repro Steps

  1. Open any local contract page
  2. Compare to playground at pal-e-playground branch 5-sync-westside-contract-html-with-deploye:westside-contract.html
  3. See: no proration label, generic schedule, extra conduct rules

Expected Behavior

Contract page matches the approved playground prototype exactly.

Environment

  • Cluster/namespace: prod / westside-contracts
  • Service version/commit: 8675712 (current main)

File Targets

  • src/routes/contract/[token]/+page.svelte:
    • Add back proratedFee calculation in script block: const proratedFee = Math.round(monthlyFee * 25 / 30 / 5) * 5;
    • Travel payment schedule (~line 303): Change First monthly fee (${monthlyFee}) to First monthly fee — prorated ($${proratedFee})
    • Local payment schedule (~line 369): Same proration change
    • Local practice schedule (~line 355-356): Replace generic text with team-specific schedules using {#if player.team_name?.includes('17U Local')} / {:else if player.team_name?.includes('16U Local')} conditionals
    • Local rules of conduct (~lines 383-388): DELETE the h3 and ul block entirely

Files NOT to touch:

  • Travel contract content (except proration label)
  • Signing section
  • Success overlay
  • Any server-side code

Acceptance Criteria

  • First monthly fee shows "prorated ($X)" with dynamic calculation on both travel and local
  • Local contract shows team-specific practice schedules (17U Local vs 16U Local)
  • Local contract has NO rules of conduct section
  • Travel contract unchanged except proration label
  • Build passes, tests pass

Test Expectations

  • Playwright: load travel contract, verify "prorated ($165)" for $200 fee player
  • Playwright: load local contract for 16U Local team, verify Monday/Friday BWill schedule
  • Playwright: load local contract, verify no "Rules of Conduct" heading
  • Run command: npm run build && npm test

Constraints

  • Match the approved playground prototype exactly
  • Proration formula: Math.round(monthlyFee * 25 / 30 / 5) * 5
  • Local schedule conditionals must handle both 17U and 16U Local, with a fallback for unknown teams

Checklist

  • PR opened
  • Tests pass
  • No unrelated changes
  • project-westside-basketball
  • Approved prototype: pal-e-playground branch 5-sync-westside-contract-html-with-deploye:westside-contract.html
### Type Bug ### Lineage `plan-wkq` → Phase 14 (Billing Tiers & Contracts) — drift from approved playground prototype ### Repo `forgejo_admin/westside-contracts` ### What Broke The deployed contract page drifted from the Marcus-approved playground prototype (`pal-e-playground` branch `5-sync-westside-contract-html-with-deploye`). Three discrepancies: **1. Proration label missing (both travel and local)** - Playground: `First monthly fee — prorated ($165)` - Deployed: `First monthly fee (${monthlyFee})` — shows full fee, no "prorated" label - Fix: Show `First monthly fee — prorated ($X)` where X is calculated dynamically: `Math.round(monthlyFee * 25 / 30 / 5) * 5`. The `proratedFee` calculation existed in the original code but was removed during date cleanup. **2. Local practice schedules missing** - Playground (lines 1050-1058): Team-specific schedules — Monday BWill 7-9 PM, Tuesday West High 6-8 PM - Deployed (line 356): Generic "Practice days and locations vary by team" - Fix: Restore team-specific schedules using `player.team_name` conditional. The original scaffold had these but they were replaced with placeholder text. - 17U Local: Monday BWill 7-9 PM, Tuesday West High Field House 6-8 PM - 16U Local: Monday BWill 7-9 PM, Friday BWill 7-9 PM **3. Rules of Conduct on local contract — should not be there** - Playground: NO rules of conduct on local contract (only on travel) - Deployed (lines 383-388): Has rules of conduct section - Fix: Remove the `<h3>Rules of Conduct</h3>` and `<ul>` block from the local contract section ### Repro Steps 1. Open any local contract page 2. Compare to playground at `pal-e-playground` branch `5-sync-westside-contract-html-with-deploye:westside-contract.html` 3. See: no proration label, generic schedule, extra conduct rules ### Expected Behavior Contract page matches the approved playground prototype exactly. ### Environment - Cluster/namespace: prod / westside-contracts - Service version/commit: `8675712` (current main) ### File Targets - `src/routes/contract/[token]/+page.svelte`: - Add back `proratedFee` calculation in script block: `const proratedFee = Math.round(monthlyFee * 25 / 30 / 5) * 5;` - Travel payment schedule (~line 303): Change `First monthly fee (${monthlyFee})` to `First monthly fee — prorated ($${proratedFee})` - Local payment schedule (~line 369): Same proration change - Local practice schedule (~line 355-356): Replace generic text with team-specific schedules using `{#if player.team_name?.includes('17U Local')}` / `{:else if player.team_name?.includes('16U Local')}` conditionals - Local rules of conduct (~lines 383-388): DELETE the h3 and ul block entirely Files NOT to touch: - Travel contract content (except proration label) - Signing section - Success overlay - Any server-side code ### Acceptance Criteria - [ ] First monthly fee shows "prorated ($X)" with dynamic calculation on both travel and local - [ ] Local contract shows team-specific practice schedules (17U Local vs 16U Local) - [ ] Local contract has NO rules of conduct section - [ ] Travel contract unchanged except proration label - [ ] Build passes, tests pass ### Test Expectations - [ ] Playwright: load travel contract, verify "prorated ($165)" for $200 fee player - [ ] Playwright: load local contract for 16U Local team, verify Monday/Friday BWill schedule - [ ] Playwright: load local contract, verify no "Rules of Conduct" heading - Run command: `npm run build && npm test` ### Constraints - Match the approved playground prototype exactly - Proration formula: `Math.round(monthlyFee * 25 / 30 / 5) * 5` - Local schedule conditionals must handle both 17U and 16U Local, with a fallback for unknown teams ### Checklist - [ ] PR opened - [ ] Tests pass - [ ] No unrelated changes ### Related - `project-westside-basketball` - Approved prototype: `pal-e-playground` branch `5-sync-westside-contract-html-with-deploye:westside-contract.html`
Author
Owner

Scope Review: READY

Review note: review-wc-17-2026-03-24
All three discrepancies verified against main branch (commit 8675712). File targets, proration formula, team conditionals, and Rules of Conduct removal all confirmed accurate. No cross-repo work needed. Downstream items (westside-app #74, westside-contracts #7) are correctly sequenced in next_up. Ready for agent execution.

## Scope Review: READY Review note: `review-wc-17-2026-03-24` All three discrepancies verified against main branch (commit 8675712). File targets, proration formula, team conditionals, and Rules of Conduct removal all confirmed accurate. No cross-repo work needed. Downstream items (westside-app #74, westside-contracts #7) are correctly sequenced in next_up. Ready for agent execution.
Sign in to join this conversation.
No labels
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
forgejo_admin/westside-contracts#17
No description provided.