Fix admin getting juror assignment email on reshuffle/COI
All checks were successful
Build and Push Docker Image / build (push) Successful in 8m46s
All checks were successful
Build and Push Docker Image / build (push) Successful in 8m46s
notifyAdmins was using BATCH_ASSIGNED notification type, which triggers
the juror assignment email template ('X Projects Assigned'). Admins
received confusing emails that looked like they were assigned projects.
Changed to EVALUATION_MILESTONE type for admin-facing reshuffle/COI
notifications. Also included top receivers in admin notification message.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -150,10 +150,11 @@ export async function reassignAfterCOI(params: {
|
|||||||
|
|
||||||
// Notify admins of the reassignment
|
// Notify admins of the reassignment
|
||||||
await notifyAdmins({
|
await notifyAdmins({
|
||||||
type: NotificationTypes.BATCH_ASSIGNED,
|
type: NotificationTypes.EVALUATION_MILESTONE,
|
||||||
title: 'COI Auto-Reassignment',
|
title: 'COI Auto-Reassignment',
|
||||||
message: `Project "${assignment.project.title}" was reassigned from ${assignment.user.name || assignment.user.email} to ${replacement.name || replacement.email} due to conflict of interest.`,
|
message: `Project "${assignment.project.title}" was reassigned from ${assignment.user.name || assignment.user.email} to ${replacement.name || replacement.email} due to conflict of interest.`,
|
||||||
linkUrl: `/admin/rounds/${roundId}`,
|
linkUrl: `/admin/rounds/${roundId}`,
|
||||||
|
linkLabel: 'View Round',
|
||||||
metadata: {
|
metadata: {
|
||||||
projectId,
|
projectId,
|
||||||
oldJurorId: assignment.userId,
|
oldJurorId: assignment.userId,
|
||||||
@@ -447,10 +448,11 @@ async function reassignDroppedJurorAssignments(params: {
|
|||||||
.join(', ')
|
.join(', ')
|
||||||
|
|
||||||
await notifyAdmins({
|
await notifyAdmins({
|
||||||
type: NotificationTypes.BATCH_ASSIGNED,
|
type: NotificationTypes.EVALUATION_MILESTONE,
|
||||||
title: 'Juror Dropout Reshuffle',
|
title: 'Juror Dropout Reshuffle',
|
||||||
message: `Reassigned ${actualMoves.length} project(s) from ${droppedName}. ${failedProjects.length > 0 ? `${failedProjects.length} project(s) could not be reassigned.` : 'All projects were reassigned.'}`,
|
message: `Reassigned ${actualMoves.length} project(s) from ${droppedName} to: ${topReceivers}. ${failedProjects.length > 0 ? `${failedProjects.length} project(s) could not be reassigned.` : 'All projects were reassigned successfully.'}`,
|
||||||
linkUrl: `/admin/rounds/${round.id}`,
|
linkUrl: `/admin/rounds/${round.id}`,
|
||||||
|
linkLabel: 'View Round',
|
||||||
metadata: {
|
metadata: {
|
||||||
roundId: round.id,
|
roundId: round.id,
|
||||||
droppedJurorId: droppedJuror.id,
|
droppedJurorId: droppedJuror.id,
|
||||||
|
|||||||
Reference in New Issue
Block a user