Show award-routed projects in filtering stats and results table
Some checks failed
Build and Push Docker Image / build (push) Has been cancelled
Some checks failed
Build and Push Docker Image / build (push) Has been cancelled
- Stats cards show new 'Award Track' card with count of confirmed SEPARATE_POOL shortlisted projects - Passed card shows breakdown (main + award) when awards are routed - Results table shows award badge on projects routed to award tracks - getResults query includes confirmed award eligibility data per project Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -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 }
|
||||
}),
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user