feat: show submission round file requirements on project edit page
All checks were successful
Build and Push Docker Image / build (push) Successful in 9m40s

Adds a new tRPC procedure `round.getSubmissionRoundForProgram` that
fetches the most recent SUBMISSION round for a given program, then
displays any `requiredDocuments` from its configJson as labeled info
cards above the general file upload section on the project edit page.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-01 14:47:42 +01:00
parent 9b3a9f6cbf
commit 68aa393559
2 changed files with 73 additions and 2 deletions

View File

@@ -861,4 +861,26 @@ export const roundRouter = router({
orderBy: { sortOrder: 'asc' },
})
}),
/**
* Get the most recent SUBMISSION round config for a program.
* Used on the project edit page to show required document slots.
*/
getSubmissionRoundForProgram: adminProcedure
.input(z.object({ programId: z.string() }))
.query(async ({ ctx, input }) => {
const round = await ctx.prisma.round.findFirst({
where: {
roundType: 'SUBMISSION',
competition: { programId: input.programId },
},
select: {
id: true,
name: true,
configJson: true,
},
orderBy: { sortOrder: 'desc' },
})
return round ?? null
}),
})