fix: 增强配置发布校验与关闭玩法清理提示
1. 发布赔率、玩法配置和风控封顶草稿前校验空配置、重复项、金额范围和合法性 2. 限制赔率返水与佣金比例在 0 到 1 之间 3. 投注预览和下单遇到已关闭玩法时返回需清理注项明细
This commit is contained in:
@@ -255,11 +255,45 @@ test('ticket place rejects disabled play from active catalog', function (): void
|
||||
])
|
||||
->assertStatus(400)
|
||||
->assertJsonPath('code', ErrorCode::PlayModeClosed->value)
|
||||
->assertJsonPath('msg', __('wallet.2002', [], 'zh'));
|
||||
->assertJsonPath('msg', __('wallet.2002', [], 'zh'))
|
||||
->assertJsonPath('data.cleanup_hint', '玩法已关闭,相关注项已清理')
|
||||
->assertJsonPath('data.cleanup_lines.0.client_line_no', 1)
|
||||
->assertJsonPath('data.cleanup_lines.0.play_code', 'big');
|
||||
|
||||
expect(TicketOrder::query()->count())->toBe(0);
|
||||
});
|
||||
|
||||
test('ticket preview returns cleanup hint when draft contains closed play', function (): void {
|
||||
$player = ticketPlayerWithWallet();
|
||||
ticketOpenDraw();
|
||||
|
||||
$versionId = PlayConfigVersion::query()
|
||||
->where('status', ConfigVersionStatus::Active->value)
|
||||
->value('id');
|
||||
expect($versionId)->not->toBeNull();
|
||||
PlayConfigItem::query()
|
||||
->where('version_id', $versionId)
|
||||
->where('play_code', 'big')
|
||||
->update(['is_enabled' => false]);
|
||||
|
||||
$this->withHeader('Authorization', 'Bearer dev:'.$player->id)
|
||||
->withHeader('X-Locale', 'zh')
|
||||
->postJson('/api/v1/ticket/preview', [
|
||||
'draw_id' => '20260511-001',
|
||||
'currency_code' => 'NPR',
|
||||
'client_trace_id' => 'trace-preview-closed-play',
|
||||
'lines' => [
|
||||
['number' => '1234', 'play_code' => 'big', 'amount' => 10_000],
|
||||
],
|
||||
])
|
||||
->assertStatus(400)
|
||||
->assertJsonPath('code', ErrorCode::PlayModeClosed->value)
|
||||
->assertJsonPath('msg', __('wallet.2002', [], 'zh'))
|
||||
->assertJsonPath('data.cleanup_hint', '玩法已关闭,相关注项已清理')
|
||||
->assertJsonPath('data.cleanup_lines.0.client_line_no', 1)
|
||||
->assertJsonPath('data.cleanup_lines.0.play_code', 'big');
|
||||
});
|
||||
|
||||
test('ticket place rejects bet amount below configured minimum', function (): void {
|
||||
$player = ticketPlayerWithWallet();
|
||||
ticketOpenDraw();
|
||||
|
||||
Reference in New Issue
Block a user