# Golf Ops V1 Deployment Runbook

## 1) Preflight
- Confirm `index.html` has production values in `window.GOLF_OPS_CONFIG`:
  - `supabaseUrl`
  - `supabaseAnonKey`
  - branding values
- Confirm Supabase schema is applied:
  - run `supabase/schema.sql`
- Confirm at least one league has data and upcoming week values.

## 2) Optional Test Data
- Run `supabase/seed_test_12_team_11_week.sql` only in test/dev environments.

## 3) Local Smoke Test
- Start local server:
  - `python3 -m http.server 4173`
- Verify flow:
  - select league/season/team/week
  - match auto-loads
  - enter a few scores
  - open review
  - verify projected totals/bonus labels
  - submit in demo/non-demo as expected

## 4) Deploy To Vercel
- Import this folder as a static project.
- No build command required.
- Output directory: `.` (project root).
- `vercel.json` is included for caching/security headers.

## 5) Post-Deploy Checks
- Open on mobile device.
- Confirm selectors load real Supabase data.
- Confirm one successful submit writes:
  - `score_submissions` row inserted
  - `matches.status` changed to `submitted`
- Confirm submitted match is no longer available for new scoring.

## 6) Rollback
- If needed, redeploy previous Vercel deployment.
- If a match was incorrectly submitted, manually update in Supabase:
  - set `matches.status` back to `scheduled`
  - delete incorrect row from `score_submissions`
