Fix round reopen bug + redesign round detail page UI
Build and Push Docker Image / build (push) Failing after 18s
Details
Build and Push Docker Image / build (push) Failing after 18s
Details
Round engine: moved logAudit() calls outside $transaction blocks to prevent FK violations from poisoning PostgreSQL transactions and rolling back status changes. Round detail page: redesigned with Editorial Command Center aesthetic - dark blue gradient header, colored accent stat cards, underline tab bar, SVG readiness ring, grouped quick actions, branded progress bars and animations. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
079468d2ca
commit
86fa542371
File diff suppressed because it is too large
Load Diff
|
|
@ -112,7 +112,6 @@ export async function activateRound(
|
|||
data: { status: 'ROUND_ACTIVE' },
|
||||
})
|
||||
|
||||
// Dual audit trail
|
||||
await tx.decisionAuditLog.create({
|
||||
data: {
|
||||
eventType: 'round.activated',
|
||||
|
|
@ -132,18 +131,18 @@ export async function activateRound(
|
|||
},
|
||||
})
|
||||
|
||||
await logAudit({
|
||||
prisma: tx,
|
||||
userId: actorId,
|
||||
action: 'ROUND_ACTIVATE',
|
||||
entityType: 'Round',
|
||||
entityId: roundId,
|
||||
detailsJson: { name: round.name, roundType: round.roundType },
|
||||
})
|
||||
|
||||
return result
|
||||
})
|
||||
|
||||
// Audit log outside transaction to avoid FK violations poisoning the tx
|
||||
await logAudit({
|
||||
userId: actorId,
|
||||
action: 'ROUND_ACTIVATE',
|
||||
entityType: 'Round',
|
||||
entityId: roundId,
|
||||
detailsJson: { name: round.name, roundType: round.roundType },
|
||||
})
|
||||
|
||||
return {
|
||||
success: true,
|
||||
round: { id: updated.id, status: updated.status },
|
||||
|
|
@ -225,18 +224,18 @@ export async function closeRound(
|
|||
},
|
||||
})
|
||||
|
||||
await logAudit({
|
||||
prisma: tx,
|
||||
userId: actorId,
|
||||
action: 'ROUND_CLOSE',
|
||||
entityType: 'Round',
|
||||
entityId: roundId,
|
||||
detailsJson: { name: round.name, roundType: round.roundType },
|
||||
})
|
||||
|
||||
return result
|
||||
})
|
||||
|
||||
// Audit log outside transaction to avoid FK violations poisoning the tx
|
||||
await logAudit({
|
||||
userId: actorId,
|
||||
action: 'ROUND_CLOSE',
|
||||
entityType: 'Round',
|
||||
entityId: roundId,
|
||||
detailsJson: { name: round.name, roundType: round.roundType },
|
||||
})
|
||||
|
||||
return {
|
||||
success: true,
|
||||
round: { id: updated.id, status: updated.status },
|
||||
|
|
@ -296,18 +295,18 @@ export async function archiveRound(
|
|||
},
|
||||
})
|
||||
|
||||
await logAudit({
|
||||
prisma: tx,
|
||||
userId: actorId,
|
||||
action: 'ROUND_ARCHIVE',
|
||||
entityType: 'Round',
|
||||
entityId: roundId,
|
||||
detailsJson: { name: round.name },
|
||||
})
|
||||
|
||||
return result
|
||||
})
|
||||
|
||||
// Audit log outside transaction to avoid FK violations poisoning the tx
|
||||
await logAudit({
|
||||
userId: actorId,
|
||||
action: 'ROUND_ARCHIVE',
|
||||
entityType: 'Round',
|
||||
entityId: roundId,
|
||||
detailsJson: { name: round.name },
|
||||
})
|
||||
|
||||
return {
|
||||
success: true,
|
||||
round: { id: updated.id, status: updated.status },
|
||||
|
|
@ -412,24 +411,24 @@ export async function reopenRound(
|
|||
},
|
||||
})
|
||||
|
||||
await logAudit({
|
||||
prisma: tx,
|
||||
userId: actorId,
|
||||
action: 'ROUND_REOPEN',
|
||||
entityType: 'Round',
|
||||
entityId: roundId,
|
||||
detailsJson: {
|
||||
name: round.name,
|
||||
pausedRounds: subsequentActiveRounds.map((r: any) => r.name),
|
||||
},
|
||||
})
|
||||
|
||||
return {
|
||||
updated,
|
||||
pausedRounds: subsequentActiveRounds.map((r: any) => r.name),
|
||||
}
|
||||
})
|
||||
|
||||
// Audit log outside transaction to avoid FK violations poisoning the tx
|
||||
await logAudit({
|
||||
userId: actorId,
|
||||
action: 'ROUND_REOPEN',
|
||||
entityType: 'Round',
|
||||
entityId: roundId,
|
||||
detailsJson: {
|
||||
name: round.name,
|
||||
pausedRounds: result.pausedRounds,
|
||||
},
|
||||
})
|
||||
|
||||
return {
|
||||
success: true,
|
||||
round: { id: result.updated.id, status: result.updated.status },
|
||||
|
|
@ -527,25 +526,25 @@ export async function transitionProject(
|
|||
},
|
||||
})
|
||||
|
||||
await logAudit({
|
||||
prisma: tx,
|
||||
userId: actorId,
|
||||
action: 'PROJECT_ROUND_TRANSITION',
|
||||
entityType: 'ProjectRoundState',
|
||||
entityId: prs.id,
|
||||
detailsJson: { projectId, roundId, newState, previousState: existing?.state ?? null },
|
||||
})
|
||||
return { prs, previousState: existing?.state ?? null }
|
||||
})
|
||||
|
||||
return prs
|
||||
// Audit log outside transaction to avoid FK violations poisoning the tx
|
||||
await logAudit({
|
||||
userId: actorId,
|
||||
action: 'PROJECT_ROUND_TRANSITION',
|
||||
entityType: 'ProjectRoundState',
|
||||
entityId: result.prs.id,
|
||||
detailsJson: { projectId, roundId, newState, previousState: result.previousState },
|
||||
})
|
||||
|
||||
return {
|
||||
success: true,
|
||||
projectRoundState: {
|
||||
id: result.id,
|
||||
projectId: result.projectId,
|
||||
roundId: result.roundId,
|
||||
state: result.state,
|
||||
id: result.prs.id,
|
||||
projectId: result.prs.projectId,
|
||||
roundId: result.prs.roundId,
|
||||
state: result.prs.state,
|
||||
},
|
||||
}
|
||||
} catch (error) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue