feat: 补充结算批次财务汇总并返回投注与利润数据

This commit is contained in:
2026-05-19 17:07:07 +08:00
parent 057ddecaa1
commit 5742853c4c
4 changed files with 56 additions and 0 deletions

View File

@@ -255,6 +255,21 @@ test('admin settlement requires review before payout and can export report', fun
->assertOk()
->assertJsonPath('data.status', 'paid');
$this->withHeader('Authorization', 'Bearer '.$token)
->getJson('/api/v1/admin/settlement-batches?draw_no=20260511-901&status=paid')
->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);
$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);
$item->refresh();
expect($item->status)->toBe('settled_win');
expect(WalletTxn::query()->where('biz_type', 'settle_payout')->count())->toBe(1);