diff --git a/app/routes/admin.sports-seasons.$id.simulate.tsx b/app/routes/admin.sports-seasons.$id.simulate.tsx index 0ccc474..6a37a2e 100644 --- a/app/routes/admin.sports-seasons.$id.simulate.tsx +++ b/app/routes/admin.sports-seasons.$id.simulate.tsx @@ -17,6 +17,7 @@ import { batchUpsertParticipantEvSnapshots } from "~/models/ev-snapshot"; import { findParticipantsBySportsSeasonId } from "~/models/participant"; import { getSimulator, type SimulatorType } from "~/services/simulations/registry"; import { calculateEV, type ScoringRules } from "~/services/ev-calculator"; +import { recalculateAffectedLeagues } from "~/models/scoring-calculator"; // Default scoring rules — matches the season table defaults. // Per-league EV is recalculated from probabilities using league-specific rules in standings. @@ -99,6 +100,9 @@ export async function action({ params }: Route.ActionArgs) { // Persist updated EVs (transactional) await batchUpsertParticipantEVs(evInputs); + // Force standings recalculation so projectedPoints reflects the new EV + await recalculateAffectedLeagues(sportsSeasonId); + // Take EV snapshot from simulation output (not re-read from DB) const today = new Date().toISOString().slice(0, 10); // YYYY-MM-DD await batchUpsertParticipantEvSnapshots(