feat: round finalization with ranking-based outcomes + award pool notifications
All checks were successful
Build and Push Docker Image / build (push) Successful in 10m0s
All checks were successful
Build and Push Docker Image / build (push) Successful in 10m0s
- processRoundClose EVALUATION uses ranking scores + advanceMode config (threshold vs count) to auto-set proposedOutcome instead of defaulting all to PASSED - Advancement emails generate invite tokens for passwordless users with "Create Your Account" CTA; rejection emails have no link - Finalization UI shows account stats (invite vs dashboard link counts) - Fixed getFinalizationSummary ranking query (was using non-existent rankingsJson) - New award pool notification system: getAwardSelectionNotificationTemplate email, notifyEligibleProjects mutation with invite token generation, "Notify Pool" button on award detail page with custom message dialog Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -18,6 +18,7 @@ import type {
|
||||
Prisma,
|
||||
} from '@prisma/client'
|
||||
import { logAudit } from '@/server/utils/audit'
|
||||
import { triggerInProgressOnActivity } from './round-engine'
|
||||
|
||||
// ─── Types ──────────────────────────────────────────────────────────────────
|
||||
|
||||
@@ -186,7 +187,7 @@ export async function submitVote(
|
||||
|
||||
const runoffRound = params.runoffRound ?? 0
|
||||
|
||||
return prisma.deliberationVote.upsert({
|
||||
const vote = await prisma.deliberationVote.upsert({
|
||||
where: {
|
||||
sessionId_juryMemberId_projectId_runoffRound: {
|
||||
sessionId: params.sessionId,
|
||||
@@ -208,6 +209,17 @@ export async function submitVote(
|
||||
isWinnerPick: params.isWinnerPick ?? false,
|
||||
},
|
||||
})
|
||||
|
||||
// Auto-transition: mark project IN_PROGRESS in the deliberation round
|
||||
try {
|
||||
if (session.roundId) {
|
||||
await triggerInProgressOnActivity(params.projectId, session.roundId, params.juryMemberId, prisma)
|
||||
}
|
||||
} catch (e) {
|
||||
console.error('[Deliberation] triggerInProgressOnActivity failed (non-fatal):', e)
|
||||
}
|
||||
|
||||
return vote
|
||||
}
|
||||
|
||||
// ─── Aggregation ────────────────────────────────────────────────────────────
|
||||
|
||||
Reference in New Issue
Block a user