feat: 更新玩法配置管理,简化字段并增强功能

- 将玩法相关的显示名称字段统一为 `display_name`,移除多语言字段。
- 在 `PlayTypePatchController` 中新增即时切换玩法开关的功能,并推送大厅更新。
- 优化多个控制器和服务中的权限检查与数据处理逻辑,提升代码可读性与维护性。
This commit is contained in:
2026-05-25 14:34:24 +08:00
parent 270d2e9af1
commit e27a00f260
74 changed files with 4469 additions and 280 deletions

View File

@@ -79,6 +79,17 @@ function jackpotOpenDraw(string $drawNo): Draw
]);
}
/** 迁移已 seed 默认 NPR 池,测试内用 upsert 避免 UNIQUE(currency_code) 冲突 */
function jackpotUpsertPool(array $attrs): JackpotPool
{
$currencyCode = (string) ($attrs['currency_code'] ?? 'NPR');
return JackpotPool::query()->updateOrCreate(
['currency_code' => $currencyCode],
$attrs,
);
}
function jackpotPublishResults(Draw $draw, string $firstNumber = '1234'): void
{
$batch = DrawResultBatch::query()->create([
@@ -115,7 +126,7 @@ function jackpotPublishResults(Draw $draw, string $firstNumber = '1234'): void
}
test('jackpot contributes on place and bursts on settle for first-prize straight', function (): void {
JackpotPool::query()->create([
jackpotUpsertPool([
'currency_code' => 'NPR',
'current_amount' => 0,
'contribution_rate' => '0.1000',
@@ -238,7 +249,7 @@ test('jackpot contributes on place and bursts on settle for first-prize straight
});
test('jackpot contribution respects switch and minimum bet threshold', function (): void {
JackpotPool::query()->create([
jackpotUpsertPool([
'currency_code' => 'NPR',
'current_amount' => 0,
'contribution_rate' => '0.1000',
@@ -288,7 +299,7 @@ test('jackpot bursts by configured play combination trigger before threshold', f
'broadcasting.connections.reverb.driver' => 'reverb',
]);
JackpotPool::query()->create([
jackpotUpsertPool([
'currency_code' => 'NPR',
'current_amount' => 50_000,
'contribution_rate' => '0.0000',
@@ -336,7 +347,7 @@ test('jackpot bursts by configured play combination trigger before threshold', f
});
test('jackpot splits burst payout between multiple winners by bet amount', function (): void {
JackpotPool::query()->create([
jackpotUpsertPool([
'currency_code' => 'NPR',
'current_amount' => 90_000,
'contribution_rate' => '0.0000',
@@ -413,7 +424,7 @@ test('jackpot summary and result payload expose pool amount and draw gap', funct
'is_reopened' => false,
]);
JackpotPool::query()->create([
jackpotUpsertPool([
'currency_code' => 'NPR',
'current_amount' => 123_456,
'contribution_rate' => '0.0100',