Fix juror drop: remove from jury group + reassign projects
All checks were successful
Build and Push Docker Image / build (push) Successful in 9m7s

The reassignDroppedJuror flow was missing a key step — after
reshuffling unsubmitted projects to other jurors, the dropped juror
was not removed from the jury group. This meant they could be
re-assigned in future assignment runs. Now deletes the JuryGroupMember
record after reshuffle, logs removal in audit, and updates the
confirmation dialog to reflect the full action.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Matt
2026-02-20 13:57:15 +01:00
parent fbcbf895be
commit 57a16d089d
2 changed files with 18 additions and 3 deletions

View File

@@ -433,6 +433,19 @@ async function reassignDroppedJurorAssignments(params: {
})
}
// Remove the dropped juror from the jury group so they can't be re-assigned
// in future assignment runs for this round's competition.
let removedFromGroup = false
if (round.juryGroupId) {
const deleted = await prisma.juryGroupMember.deleteMany({
where: {
juryGroupId: round.juryGroupId,
userId: params.droppedJurorId,
},
})
removedFromGroup = deleted.count > 0
}
if (params.auditUserId) {
await logAudit({
prisma,
@@ -448,6 +461,7 @@ async function reassignDroppedJurorAssignments(params: {
failedProjects,
skippedProjects,
reassignedTo,
removedFromGroup,
},
ipAddress: params.auditIp,
userAgent: params.auditUserAgent,