fix(settlement): 要求封盘后才能结算并优化预览流程
封盘前禁止录入比分与生成预览;待结算未确认前可解除封盘。 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user