Centralize futures odds onto the simulator page and fix bulk import #117

Merged
chrisp merged 3 commits from claude/futures-bulk-import-cleanup-c2ly3y into main 2026-06-30 17:05:52 +00:00

3 commits

Author SHA1 Message Date
Claude
051e68437d
Fix lint errors (unused import, eqeqeq)
All checks were successful
🚀 Deploy / 🧪 Test (pull_request) Successful in 2m53s
🚀 Deploy / ʦ🔍 Typecheck & Lint (pull_request) Successful in 1m16s
🚀 Deploy / 🐳 Build (pull_request) Has been skipped
🚀 Deploy / 🚀 Deploy (pull_request) Has been skipped
- Drop now-unused `inArray` import from participant-expected-value.ts
  (only the removed clearSourceOddsForParticipants used it).
- Use strict null/undefined check instead of `== null` in the test helper.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BHnoQ7myY3PzNdTnd7iGNE
2026-06-30 16:58:48 +00:00
Claude
95f0e0612f
Fix metadata clobbering and misleading auto-run message
Some checks failed
🚀 Deploy / 🧪 Test (pull_request) Successful in 2m58s
🚀 Deploy / ʦ🔍 Typecheck & Lint (pull_request) Failing after 47s
🚀 Deploy / 🐳 Build (pull_request) Has been skipped
🚀 Deploy / 🚀 Deploy (pull_request) Has been skipped
Address two issues from code review:

- batchUpsertParticipantSimulatorInputs blindly COALESCE'd the metadata
  column, preserving a stale sourceEloMethod/ratingMethod flag. A freshly
  entered direct Elo/rating (Elo-ratings page, or the bulk CSV importer) was
  then misclassified as generated and filtered out by
  getParticipantSimulatorInputs, so the entered value was silently ignored.
  Metadata now uses explicit caller metadata when given, otherwise preserves
  existing flags but drops the method flag for any column receiving a fresh
  direct value.
- The save-inputs auto-run catch reported success with "Simulation not run
  yet" even when the simulation started and failed mid-run (leaving the season
  in status 'failed'). It now re-checks the season status and reports a real
  run failure distinctly from a not-ready/never-started run.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BHnoQ7myY3PzNdTnd7iGNE
2026-06-30 16:30:23 +00:00
Claude
b50a2b8c09
Centralize futures odds onto the simulator page and fix bulk import
Some checks failed
🚀 Deploy / 🧪 Test (pull_request) Successful in 3m1s
🚀 Deploy / ʦ🔍 Typecheck & Lint (pull_request) Failing after 46s
🚀 Deploy / 🐳 Build (pull_request) Has been skipped
🚀 Deploy / 🚀 Deploy (pull_request) Has been skipped
Futures odds entry was split across two unrelated places: a standalone
/futures-odds page (which auto-ran the simulation on save and surfaced a
"Simulator is not ready" run failure as if the save itself had failed) and
the Bulk Simulator Inputs CSV importer on the simulator setup page.

Consolidate everything onto the Bulk Simulator Inputs card:

- batchUpsertParticipantSimulatorInputs now COALESCE-wraps every conflict
  update column, so a partial paste (e.g. odds-only) updates just the columns
  it provides instead of nulling out previously stored Elo/rating/etc.
- The bulk importer accepts sportsbook-style paste (one team per line ending
  in American odds) when no CSV header is present, reusing the existing fuzzy
  matcher, and auto-runs the simulation on save. A not-ready run is reported
  as a successful save plus the readiness gap, never as a failed save.
- Retire the standalone /futures-odds page (now redirects to the simulator
  setup page) and drop the redundant Futures links.
- Remove the now-dead futures-only model paths (batchSaveSourceOdds,
  clearSourceOddsForParticipants, batchSaveFuturesOddsForSimulator,
  batchSaveParticipantSimulatorSourceOdds); the EV-table bridge is preserved
  by batchUpsertParticipantSimulatorInputs.
- Repoint the test to the consolidated path and assert the non-destructive
  COALESCE behaviour.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BHnoQ7myY3PzNdTnd7iGNE
2026-06-30 16:20:40 +00:00