fix(settlement): 要求封盘后才能结算并优化预览流程

封盘前禁止录入比分与生成预览;待结算未确认前可解除封盘。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-06-11 17:49:34 +08:00
parent 03e72ca9b2
commit e469611138
9 changed files with 210 additions and 54 deletions

View File

@@ -27,15 +27,16 @@ async function confirmMatchSettlement(
fx: BetFlowFixtureIds,
score: { htHome: number; htAway: number; ftHome: number; ftAway: number },
) {
await deps.settlement.recordScore(
fx.matchId,
score.htHome,
score.htAway,
score.ftHome,
score.ftAway,
fx.operatorId,
);
const preview = await deps.settlement.previewSettlement(fx.matchId, fx.operatorId);
await deps.prisma.match.update({
where: { id: fx.matchId },
data: { status: 'CLOSED', closeTime: new Date() },
});
const preview = await deps.settlement.previewSettlement(fx.matchId, fx.operatorId, {
htHome: score.htHome,
htAway: score.htAway,
ftHome: score.ftHome,
ftAway: score.ftAway,
});
await deps.settlement.confirmSettlement(preview.batch.id, fx.operatorId);
}