feat: 充值订单审计与重新申请,优化赛事展示和余额刷新

- 新增 deposit_order_audit_logs 表,记录提交/审批/拒绝/撤销/重提全链路
- 管理端充值单页增加审计历史;玩家端充值历史支持时间线与重新申请
- 已拒绝订单可原单号重提;撤销入账使用 PLAYER_DEPOSIT_REVERSAL 并加强幂等
- 结算后清除热门标记,允许归档已结算赛事,完善今日赛事时区窗口
- 足球页今日/早盘独立折叠;资料与余额在进入钱包/个人页及下注后自动刷新
- 补充投注玩法、结算返水规则文档;新增 smoke/settlement CLI 脚本

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-06-15 14:52:05 +08:00
parent 73a94e6be3
commit afb5c5437e
55 changed files with 3050 additions and 160 deletions

View File

@@ -386,6 +386,7 @@ describe('SettlementService outright winner flow', () => {
it('confirmSettlement settles outright bets as WON/LOST using stored winnerTeamId', async () => {
const txBetUpdate = jest.fn().mockResolvedValue({});
const txBetUpdateMany = jest.fn().mockResolvedValue({ count: 1 });
const txMatchUpdate = jest.fn().mockResolvedValue({});
transaction.mockImplementation(async (fn: (client: unknown) => Promise<void>) => {
await fn({
team: { findUnique: teamFindUnique },
@@ -404,7 +405,7 @@ describe('SettlementService outright winner flow', () => {
update: jest.fn().mockResolvedValue({}),
updateMany: jest.fn().mockResolvedValue({ count: 1 }),
},
match: { update: jest.fn().mockResolvedValue({}) },
match: { update: txMatchUpdate },
});
});
settlementBatchFindUnique.mockResolvedValue({
@@ -464,6 +465,12 @@ describe('SettlementService outright winner flow', () => {
data: expect.objectContaining({ status: 'LOST' }),
}),
);
expect(txMatchUpdate).toHaveBeenCalledWith(
expect.objectContaining({
where: { id: matchId },
data: { status: 'SETTLED', isHot: false },
}),
);
expect(result).toEqual({ success: true, batchId: batchId.toString() });
});
});

View File

@@ -1099,7 +1099,7 @@ export class SettlementService {
await tx.match.update({
where: { id: currentBatch.matchId },
data: { status: 'SETTLED' },
data: { status: 'SETTLED', isHot: false },
});
});