diff --git a/src/components/admin/round/filtering-dashboard.tsx b/src/components/admin/round/filtering-dashboard.tsx index 4828a13..1827e1a 100644 --- a/src/components/admin/round/filtering-dashboard.tsx +++ b/src/components/admin/round/filtering-dashboard.tsx @@ -686,7 +686,7 @@ export function FilteringDashboard({ competitionId, roundId }: FilteringDashboar ))} ) : stats && stats.total > 0 ? ( -
+
Total @@ -706,6 +706,11 @@ export function FilteringDashboard({ competitionId, roundId }: FilteringDashboar
{stats.passed}

{stats.total > 0 ? `${((stats.passed / stats.total) * 100).toFixed(0)}%` : '0%'} + {stats.routedToAwards > 0 && ( + + {stats.passed - stats.routedToAwards} main + {stats.routedToAwards} award + + )}

@@ -741,6 +746,18 @@ export function FilteringDashboard({ competitionId, roundId }: FilteringDashboar

Manual changes

+ {stats.routedToAwards > 0 && ( + + + Award Track + + + +
{stats.routedToAwards}
+

Routed to awards

+
+
+ )}
) : null} @@ -878,13 +895,21 @@ export function FilteringDashboard({ competitionId, roundId }: FilteringDashboar )}
- e.stopPropagation()} - > - {result.project?.title || 'Unknown'} - +
+ e.stopPropagation()} + > + {result.project?.title || 'Unknown'} + + {result.project?.awardEligibilities?.length > 0 && ( + + + {result.project.awardEligibilities[0].award.name} + + )} +

{result.project?.teamName} {result.project?.country && ` \u00b7 ${result.project.country}`} diff --git a/src/server/routers/filtering.ts b/src/server/routers/filtering.ts index 41dec0d..990b105 100644 --- a/src/server/routers/filtering.ts +++ b/src/server/routers/filtering.ts @@ -877,6 +877,16 @@ export const filteringRouter = router({ teamName: true, competitionCategory: true, country: true, + awardEligibilities: { + where: { + shortlisted: true, + confirmedAt: { not: null }, + award: { eligibilityMode: 'SEPARATE_POOL' }, + }, + select: { + award: { select: { name: true } }, + }, + }, }, }, overriddenByUser: { @@ -936,7 +946,27 @@ export const filteringRouter = router({ }), ]) - return { passed, filteredOut, flagged, overridden, total: passed + filteredOut + flagged } + // Count projects routed to SEPARATE_POOL award tracks (confirmed shortlist) + const round = await ctx.prisma.round.findUnique({ + where: { id: input.roundId }, + select: { competitionId: true }, + }) + + let routedToAwards = 0 + if (round?.competitionId) { + routedToAwards = await ctx.prisma.awardEligibility.count({ + where: { + award: { + competitionId: round.competitionId, + eligibilityMode: 'SEPARATE_POOL', + }, + shortlisted: true, + confirmedAt: { not: null }, + }, + }) + } + + return { passed, filteredOut, flagged, overridden, routedToAwards, total: passed + filteredOut + flagged } }), /**