Contract shows hardcoded schedule instead of querying practice_schedules table #49

Closed
opened 2026-04-12 19:29:44 +00:00 by forgejo_admin · 1 comment
Contributor

Type

Bug

Lineage

Standalone — discovered during contract review for Neveah (16U Local).

Repo

forgejo_admin/westside-contracts

What Broke

Contract page (/contract/[token]/+page.svelte) displays hardcoded practice schedules instead of querying the practice_schedules table. Three separate hardcoded blocks exist:

  • Boys Travel (lines 323-334): Sunday/Tuesday/Thursday with static locations
  • Girls Travel (lines 489-501): Tuesday/Thursday/Wednesday with static locations
  • Local (lines 586-597): Branches on team name string — 16U Local → Mon/Friday, 17U Local → Mon/Tue

Neveah (16U Local) was shown Friday when her actual practices are Tuesday/Wednesday. This is wrong data on a legal document.

The practice_schedules table already exists in the basketball database with team_id, day_of_week, start_time, end_time, location. westside-contracts connects to the same database but never queries this table.

Repro Steps

  1. Open Neveah's contract URL (/contract/[her-token])
  2. Scroll to Practice Schedule section
  3. Observe: shows Monday + Friday at BWill

Expected Behavior

Contract should show the practice days/times/locations from practice_schedules for the player's team — not hardcoded values.

Environment

  • Cluster/namespace: prod / westside-contracts
  • Service: westside-contracts (SvelteKit adapter-node)
  • Database: basketball (shared with basketball-api)

Acceptance Criteria

  • +page.server.ts queries practice_schedules joined via player_teams.team_id
  • +page.svelte replaces all three hardcoded schedule blocks with a single dynamic {#each} loop
  • Fallback message shown when no practices exist for the team
  • 16U Local contract shows correct days from DB
  • Boys travel contract shows correct days from DB
  • Girls travel contract shows correct days from DB
  • westside-basketball — project this affects
  • File targets: src/routes/contract/[token]/+page.server.ts, src/routes/contract/[token]/+page.svelte, src/lib/types.ts
### Type Bug ### Lineage Standalone — discovered during contract review for Neveah (16U Local). ### Repo `forgejo_admin/westside-contracts` ### What Broke Contract page (`/contract/[token]/+page.svelte`) displays hardcoded practice schedules instead of querying the `practice_schedules` table. Three separate hardcoded blocks exist: - **Boys Travel** (lines 323-334): Sunday/Tuesday/Thursday with static locations - **Girls Travel** (lines 489-501): Tuesday/Thursday/Wednesday with static locations - **Local** (lines 586-597): Branches on team name string — `16U Local` → Mon/**Friday**, `17U Local` → Mon/Tue **Neveah (16U Local) was shown Friday when her actual practices are Tuesday/Wednesday.** This is wrong data on a legal document. The `practice_schedules` table already exists in the `basketball` database with `team_id`, `day_of_week`, `start_time`, `end_time`, `location`. westside-contracts connects to the same database but never queries this table. ### Repro Steps 1. Open Neveah's contract URL (`/contract/[her-token]`) 2. Scroll to Practice Schedule section 3. Observe: shows Monday + Friday at BWill ### Expected Behavior Contract should show the practice days/times/locations from `practice_schedules` for the player's team — not hardcoded values. ### Environment - Cluster/namespace: prod / westside-contracts - Service: westside-contracts (SvelteKit adapter-node) - Database: `basketball` (shared with basketball-api) ### Acceptance Criteria - [ ] `+page.server.ts` queries `practice_schedules` joined via `player_teams.team_id` - [ ] `+page.svelte` replaces all three hardcoded schedule blocks with a single dynamic `{#each}` loop - [ ] Fallback message shown when no practices exist for the team - [ ] 16U Local contract shows correct days from DB - [ ] Boys travel contract shows correct days from DB - [ ] Girls travel contract shows correct days from DB ### Related - `westside-basketball` — project this affects - File targets: `src/routes/contract/[token]/+page.server.ts`, `src/routes/contract/[token]/+page.svelte`, `src/lib/types.ts`
Author
Contributor

Scope Review: READY

Review note: review-995-2026-04-12
All file targets verified, hardcoded schedule blocks confirmed at stated line numbers, practice_schedules table exists and is seeded, westside-contracts connects to the same database. No cross-repo changes needed. Ready for dispatch.

## Scope Review: READY Review note: `review-995-2026-04-12` All file targets verified, hardcoded schedule blocks confirmed at stated line numbers, `practice_schedules` table exists and is seeded, westside-contracts connects to the same database. No cross-repo changes needed. Ready for dispatch.
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
ldraney/westside-contracts#49
No description provided.