feat: add clickable projects and doc counts to finalization page
All checks were successful
Build and Push Docker Image / build (push) Successful in 8m36s

Project names now link to their detail page on all finalization tabs.
Submission/intake rounds show a docs submitted/required column.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Matt
2026-04-09 11:38:05 -04:00
parent a51241f7ff
commit 498baa7e01
2 changed files with 58 additions and 2 deletions

View File

@@ -44,6 +44,8 @@ export type FinalizationSummary = {
proposedOutcome: ProjectRoundStateValue | null
evaluationScore?: number | null
rankPosition?: number | null
documentsSubmitted?: number | null
documentsRequired?: number | null
}>
categoryTargets: {
startupTarget: number | null
@@ -487,6 +489,34 @@ export async function getFinalizationSummary(
}
}
// Get document submission counts for SUBMISSION/INTAKE rounds
let documentsRequired: number | null = null
let docCountMap = new Map<string, number>()
if (round.roundType === 'SUBMISSION' || round.roundType === 'INTAKE') {
const requirements = await prisma.fileRequirement.findMany({
where: { roundId, isRequired: true },
select: { id: true },
})
documentsRequired = requirements.length
if (documentsRequired > 0) {
const projectIds = projectStates.map((prs: any) => prs.project.id)
const fileCounts = await prisma.projectFile.groupBy({
by: ['projectId'],
where: {
roundId,
projectId: { in: projectIds },
requirementId: { in: requirements.map((r) => r.id) },
},
_count: { _all: true },
})
for (const fc of fileCounts) {
docCountMap.set(fc.projectId, fc._count._all)
}
}
}
// Build project list
const projects = projectStates.map((prs: any) => ({
id: prs.project.id,
@@ -498,6 +528,8 @@ export async function getFinalizationSummary(
proposedOutcome: prs.proposedOutcome as ProjectRoundStateValue | null,
evaluationScore: scoreMap.get(prs.project.id) ?? null,
rankPosition: rankMap.get(prs.project.id) ?? null,
documentsSubmitted: documentsRequired != null ? (docCountMap.get(prs.project.id) ?? 0) : null,
documentsRequired,
}))
// Category target progress