feat(series): run each round from the series page

Step 3 becomes a rounds table: pick drivers inline (copy from the
previous round, add a late entry), set qualifying rounds/finals/max
cars per heat per round, see the status, and create qualifying and
finals from there. Qualifying heats are now split evenly so nobody
drives alone.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
larssandandClaude Opus 5.5 committed 2026-10-11 18:55:36 +02:00
1 parent 581ec2c781
commit b5707f92d1
17 files changed
+447 -39

No files matched your search

+13
View File
@@ -149,3 +149,16 @@ export function buildSeriesStandings(series, { events = [], dayResults = new Map
};
});
}
// Where a round (one race) stands, from its sessions: not started -> qualifying created ->
// qualifying running -> qualifying done -> finals -> done.
export function getSeriesRoundStatus(sessions = []) {
const quals = sessions.filter((session) => session.type === "qualification");
const finals = sessions.filter((session) => session.type === "final");
const finished = (list) => list.length > 0 && list.every((session) => session.status === "finished");
const started = (list) => list.some((session) => ["running", "paused", "finished"].includes(session.status));
if (finals.length) return finished(finals) ? "done" : "finals";
if (!quals.length) return "not_started";
if (finished(quals)) return "qual_done";
return started(quals) ? "qual_running" : "qual_ready";
}