fix(assignments): make reshuffle concurrency-safe; preserve juryGroupId
All checks were successful
Build and Push Docker Image / build (push) Successful in 8m16s
All checks were successful
Build and Push Docker Image / build (push) Successful in 8m16s
This commit is contained in:
@@ -15,6 +15,7 @@ import type {
|
||||
CompetitionStatus,
|
||||
ProjectRoundStateValue,
|
||||
AssignmentMethod,
|
||||
EvaluationStatus,
|
||||
} from '@prisma/client'
|
||||
|
||||
export function uid(prefix = 'test'): string {
|
||||
@@ -176,6 +177,7 @@ export async function createTestAssignment(
|
||||
overrides: Partial<{
|
||||
method: AssignmentMethod
|
||||
isCompleted: boolean
|
||||
juryGroupId: string
|
||||
}> = {},
|
||||
) {
|
||||
return prisma.assignment.create({
|
||||
@@ -185,6 +187,29 @@ export async function createTestAssignment(
|
||||
roundId,
|
||||
method: overrides.method ?? 'MANUAL',
|
||||
isCompleted: overrides.isCompleted ?? false,
|
||||
juryGroupId: overrides.juryGroupId ?? undefined,
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
// ─── Evaluation Factory ───────────────────────────────────────────────────
|
||||
|
||||
export async function createTestEvaluation(
|
||||
assignmentId: string,
|
||||
formId: string,
|
||||
overrides: Partial<{
|
||||
status: 'NOT_STARTED' | 'DRAFT' | 'SUBMITTED' | 'LOCKED'
|
||||
globalScore: number
|
||||
submittedAt: Date
|
||||
}> = {},
|
||||
) {
|
||||
return prisma.evaluation.create({
|
||||
data: {
|
||||
assignmentId,
|
||||
formId,
|
||||
status: overrides.status ?? 'NOT_STARTED',
|
||||
globalScore: overrides.globalScore ?? null,
|
||||
submittedAt: overrides.submittedAt ?? null,
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user