feat(final-docs): judge review page + entry points

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Matt
2026-06-09 15:44:37 +02:00
parent e9e072dda7
commit df0be6bb48
4 changed files with 168 additions and 2 deletions

View File

@@ -54,6 +54,20 @@ export const competitionRouter = router({
return competition
}),
/**
* Resolve the id of the most-recent ACTIVE program for the logged-in user.
* Used by client pages (e.g. the finalist-documents judge review) that need a
* programId but don't have one in the route. Returns null when none is active.
*/
getActiveProgramId: protectedProcedure.query(async ({ ctx }) => {
const program = await ctx.prisma.program.findFirst({
where: { status: 'ACTIVE' },
orderBy: { year: 'desc' },
select: { id: true },
})
return program?.id ?? null
}),
/**
* Get competition by ID with rounds, jury groups, and submission windows
*/