feat: 切换 schema dump 基线并增强返点结算与管理校验
This commit is contained in:
@@ -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',
|
||||
]);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user