From 7b16873b9c6bbb0b9df7d5ecbb4e212c1464fca2 Mon Sep 17 00:00:00 2001 From: Matt Date: Wed, 18 Feb 2026 11:31:13 +0100 Subject: [PATCH] Fix finalize to actually advance passed projects to next round MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit finalizeResults was finding nextRound but never creating ProjectRoundState entries — projects got set to ELIGIBLE but were not placed into the next round. Now creates entries with skipDuplicates so it's safe to re-run. Co-Authored-By: Claude Opus 4.6 --- src/server/routers/filtering.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/server/routers/filtering.ts b/src/server/routers/filtering.ts index eb264c1..8ae8279 100644 --- a/src/server/routers/filtering.ts +++ b/src/server/routers/filtering.ts @@ -1201,6 +1201,19 @@ export const filteringRouter = router({ ) } + // Advance passed projects to the next round + if (nextRound && mainPoolPassedIds.length > 0) { + operations.push( + ctx.prisma.projectRoundState.createMany({ + data: mainPoolPassedIds.map((projectId) => ({ + projectId, + roundId: nextRound.id, + })), + skipDuplicates: true, + }) + ) + } + await ctx.prisma.$transaction(operations) await logAudit({