diff --git a/app/routes/admin.sports-seasons.$id.futures-odds.tsx b/app/routes/admin.sports-seasons.$id.futures-odds.tsx
index 2e3a99c..f3bef04 100644
--- a/app/routes/admin.sports-seasons.$id.futures-odds.tsx
+++ b/app/routes/admin.sports-seasons.$id.futures-odds.tsx
@@ -6,6 +6,7 @@ import { getAllParticipantEVsForSeason } from '~/models/participant-expected-val
import { Button } from '~/components/ui/button';
import { Input } from '~/components/ui/input';
import { Label } from '~/components/ui/label';
+import { Textarea } from '~/components/ui/textarea';
import {
Card,
CardContent,
@@ -18,11 +19,8 @@ import {
calculateICMFromOdds,
icmResultToArray,
} from '~/services/icm-calculator';
-import {
- upsertParticipantEV,
- upsertParticipantEVWithNormalization,
-} from '~/models/participant-expected-value';
-import { Loader2, Info } from 'lucide-react';
+import { upsertParticipantEV } from '~/models/participant-expected-value';
+import { Loader2, Info, CheckCircle2, AlertCircle } from 'lucide-react';
export async function loader({ params }: Route.LoaderArgs) {
const sportsSeasonId = params.id;
@@ -132,13 +130,6 @@ export async function action({ request, params }: Route.ActionArgs) {
// Save probabilities from preview (passed through form)
// This ensures saved values match exactly what user saw in preview
for (const { participantId, odds } of futuresOdds) {
- // Debug: check what's in form data
- const probFirstRaw = formData.get(`prob_first_${participantId}`);
- const probSecondRaw = formData.get(`prob_second_${participantId}`);
- console.log(`[Futures Odds Save DEBUG] Looking for participant ${participantId}`);
- console.log(` prob_first_${participantId} = ${probFirstRaw} (type: ${typeof probFirstRaw})`);
- console.log(` prob_second_${participantId} = ${probSecondRaw} (type: ${typeof probSecondRaw})`);
-
// Read probabilities from form data (preview results)
const probFirst = parseFloat(formData.get(`prob_first_${participantId}`) as string) || 0;
const probSecond = parseFloat(formData.get(`prob_second_${participantId}`) as string) || 0;
@@ -149,11 +140,9 @@ export async function action({ request, params }: Route.ActionArgs) {
const probSeventh = parseFloat(formData.get(`prob_seventh_${participantId}`) as string) || 0;
const probEighth = parseFloat(formData.get(`prob_eighth_${participantId}`) as string) || 0;
- console.log(`[Futures Odds Save] ${participantId}: P(1st)=${probFirst}, P(2nd)=${probSecond}, P(3rd)=${probThird}, P(4th)=${probFourth}, P(5th)=${probFifth}, P(6th)=${probSixth}, P(7th)=${probSeventh}, P(8th)=${probEighth}, sum=${probFirst+probSecond+probThird+probFourth+probFifth+probSixth+probSeventh+probEighth}`);
-
// Use upsertParticipantEV (not WithNormalization) because ICM probabilities
// are already correct - they sum to <1.0 for teams unlikely to finish top 8
- const result = await upsertParticipantEV({
+ await upsertParticipantEV({
participantId,
sportsSeasonId: sportsSeasonId,
probabilities: {
@@ -170,11 +159,8 @@ export async function action({ request, params }: Route.ActionArgs) {
source: 'futures_odds',
sourceOdds: odds,
});
-
- console.log(`[Futures Odds Save] Saved ${participantId}: DB probFirst=${result.probFirst}, EV=${result.expectedValue}`);
}
- console.log('[Futures Odds Save] All probabilities saved, redirecting...');
return redirect(`/admin/sports-seasons/${sportsSeasonId}/expected-values`);
}
@@ -188,6 +174,10 @@ export async function action({ request, params }: Route.ActionArgs) {
}
}
+function normalizeName(name: string): string {
+ return name.toLowerCase().replace(/[^a-z0-9\s]/g, '').replace(/\s+/g, ' ').trim();
+}
+
export default function AdminSportsSeasonFuturesOdds() {
const { sportsSeason, participants, existingOdds } = useLoaderData
Kansas City Chiefs +450). Team names are fuzzy-matched to
+ participants.
+