feat: 补充结算批次财务汇总并返回投注与利润数据
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user