feat(lottery): 扩展传统马来赔率、玩法结算与开注商短码支持
Some checks failed
lotterLaravel CI / test (push) Has been cancelled
lotterLaravel E2E / e2e-api (push) Has been cancelled

This commit is contained in:
2026-07-10 17:04:28 +08:00
parent 2ea3e810a0
commit cbb18b976f
24 changed files with 320 additions and 45 deletions

View File

@@ -134,7 +134,7 @@ test('settlement pays big winner and marks ticket settled', function (): void {
$item = TicketItem::query()->where('draw_id', $draw->id)->firstOrFail();
expect($item->status)->toBe('settled_win');
expect((int) $item->win_amount)->toBe(250_000);
expect((int) $item->win_amount)->toBe(25_000_000);
$order = TicketOrder::query()->whereKey($item->order_id)->firstOrFail();
expect($order->status)->toBe('settled');
@@ -142,7 +142,7 @@ test('settlement pays big winner and marks ticket settled', function (): void {
expect(SettlementBatch::query()->where('draw_id', $draw->id)->count())->toBe(1);
$wallet = PlayerWallet::query()->where('player_id', $player->id)->firstOrFail();
expect((int) $wallet->balance)->toBe(5_000_000 - (int) $item->actual_deduct_amount + 250_000);
expect((int) $wallet->balance)->toBe(5_000_000 - (int) $item->actual_deduct_amount + 25_000_000);
expect(WalletTxn::query()->where('biz_type', 'settle_payout')->count())->toBe(1);
});
@@ -403,15 +403,15 @@ test('admin settlement requires review before payout and can export report', fun
->assertOk()
->assertJsonPath('data.items.0.total_bet_amount', 10_000)
->assertJsonPath('data.items.0.total_actual_deduct', 10_000)
->assertJsonPath('data.items.0.total_payout_amount', 250_000)
->assertJsonPath('data.items.0.platform_profit', -240_000);
->assertJsonPath('data.items.0.total_payout_amount', 25_000_000)
->assertJsonPath('data.items.0.platform_profit', -24_990_000);
$this->withHeader('Authorization', 'Bearer '.$token)
->getJson("/api/v1/admin/settlement-batches/{$settlement->id}")
->assertOk()
->assertJsonPath('data.total_bet_amount', 10_000)
->assertJsonPath('data.total_actual_deduct', 10_000)
->assertJsonPath('data.platform_profit', -240_000);
->assertJsonPath('data.platform_profit', -24_990_000);
$item->refresh();
expect($item->status)->toBe('settled_win');