Add auto-pass & advance for intake rounds (no manual marking needed)

For INTAKE, SUBMISSION, and MENTORING rounds, the Advance Projects dialog
now shows a simplified "Advance All" flow that auto-passes all pending
projects and advances them in one click. Backend accepts autoPassPending
flag to bulk-set PENDING→PASSED before advancing. Jury/evaluation rounds
keep the existing per-project selection workflow.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Matt
2026-02-16 19:09:23 +01:00
parent fcee8761b9
commit cfeef9a601
2 changed files with 102 additions and 36 deletions

View File

@@ -243,10 +243,11 @@ export const roundRouter = router({
roundId: z.string(),
targetRoundId: z.string().optional(),
projectIds: z.array(z.string()).optional(),
autoPassPending: z.boolean().optional(),
})
)
.mutation(async ({ ctx, input }) => {
const { roundId, targetRoundId, projectIds } = input
const { roundId, targetRoundId, projectIds, autoPassPending } = input
// Get current round with competition context
const currentRound = await ctx.prisma.round.findUniqueOrThrow({
@@ -280,6 +281,16 @@ export const roundRouter = router({
targetRound = nextRound
}
// Auto-pass all PENDING projects first (for intake/bulk workflows)
let autoPassedCount = 0
if (autoPassPending) {
const result = await ctx.prisma.projectRoundState.updateMany({
where: { roundId, state: 'PENDING' },
data: { state: 'PASSED' },
})
autoPassedCount = result.count
}
// Determine which projects to advance
let idsToAdvance: string[]
if (projectIds && projectIds.length > 0) {
@@ -346,6 +357,7 @@ export const roundRouter = router({
toRound: targetRound.name,
targetRoundId: targetRound.id,
projectCount: idsToAdvance.length,
autoPassedCount,
projectIds: idsToAdvance,
},
ipAddress: ctx.ip,
@@ -354,6 +366,7 @@ export const roundRouter = router({
return {
advancedCount: idsToAdvance.length,
autoPassedCount,
targetRoundId: targetRound.id,
targetRoundName: targetRound.name,
}