Fix finalize to actually advance passed projects to next round
Some checks failed
Build and Push Docker Image / build (push) Has been cancelled

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 <noreply@anthropic.com>
This commit is contained in:
Matt
2026-02-18 11:31:13 +01:00
parent fc7a37094b
commit 7b16873b9c

View File

@@ -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 ctx.prisma.$transaction(operations)
await logAudit({ await logAudit({