Fix finalize to actually advance passed projects to next round
Some checks failed
Build and Push Docker Image / build (push) Has been cancelled
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:
@@ -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({
|
||||||
|
|||||||
Reference in New Issue
Block a user