feat: 切换 schema dump 基线并增强返点结算与管理校验

This commit is contained in:
2026-06-08 17:41:41 +08:00
parent 2d32f006c5
commit 8d5d7f5b17
130 changed files with 5746 additions and 6723 deletions

View File

@@ -165,3 +165,28 @@ test('enabling currency as bettable bootstraps odds items and jackpot pool', fun
'currency_code' => 'USD',
]);
});
test('cannot delete currency referenced by admin site default currency', function (): void {
$token = mintCurrencyAdminToken();
Currency::query()->create([
'code' => 'EUR',
'name' => 'Euro',
'decimal_places' => 2,
'is_enabled' => true,
'is_bettable' => false,
]);
DB::table('admin_sites')
->where('is_default', true)
->update(['currency_code' => 'EUR']);
$this->withHeader('Authorization', 'Bearer '.$token)
->deleteJson('/api/v1/admin/currencies/EUR')
->assertStatus(422)
->assertJsonPath('data.references.0', '站点默认币种');
$this->assertDatabaseHas('currencies', [
'code' => 'EUR',
]);
});