@@ -347,10 +348,13 @@ export function ProjectStatesTable({ competitionId, roundId }: ProjectStatesTabl
{filtered.map((ps: any) => {
const cfg = stateConfig[ps.state as ProjectState] || stateConfig.PENDING
const StateIcon = cfg.icon
+ const total = ps.totalAssignments ?? 0
+ const submitted = ps.submittedCount ?? 0
+ const allDone = total > 0 && submitted === total
return (
+
+ {total > 0 ? (
+
+ {submitted}/{total}
+
+ ) : (
+ —
+ )}
+
{ps.enteredAt ? new Date(ps.enteredAt).toLocaleDateString() : '—'}
diff --git a/src/server/services/round-engine.ts b/src/server/services/round-engine.ts
index 27c4c0a..9fc75de 100644
--- a/src/server/services/round-engine.ts
+++ b/src/server/services/round-engine.ts
@@ -703,7 +703,7 @@ export async function getProjectRoundStates(
roundId: string,
prisma: PrismaClient | any,
) {
- return prisma.projectRoundState.findMany({
+ const states = await prisma.projectRoundState.findMany({
where: { roundId },
include: {
project: {
@@ -714,11 +714,37 @@ export async function getProjectRoundStates(
competitionCategory: true,
country: true,
status: true,
+ assignments: {
+ where: { roundId },
+ select: {
+ id: true,
+ isCompleted: true,
+ evaluation: { select: { status: true } },
+ },
+ },
},
},
},
orderBy: { enteredAt: 'desc' },
})
+
+ // Compute evaluation progress per project
+ return states.map((ps: any) => {
+ const assignments = ps.project?.assignments ?? []
+ const totalAssignments = assignments.length
+ const submittedCount = assignments.filter(
+ (a: any) => a.evaluation?.status === 'SUBMITTED'
+ ).length
+ return {
+ ...ps,
+ totalAssignments,
+ submittedCount,
+ project: {
+ ...ps.project,
+ assignments: undefined, // strip raw assignments from response
+ },
+ }
+ })
}
export async function getProjectRoundState(