feat: 扩展玩法配置快照字段并切换目录生效来源

This commit is contained in:
2026-05-16 10:27:59 +08:00
parent f7f6c58b02
commit 7daf0c3bba
15 changed files with 254 additions and 47 deletions

View File

@@ -3,7 +3,6 @@
namespace App\Services\Ticket;
use App\Models\OddsItem;
use App\Models\PlayType;
use App\Lottery\ErrorCode;
use App\Models\OddsVersion;
use App\Models\RiskCapItem;
@@ -80,18 +79,10 @@ final class PlayCatalogResolver
}
/**
* @return array{play_type: PlayType, play_config: PlayConfigItem, odds_items: Collection<int, OddsItem>}
* @return array{play_config: PlayConfigItem, odds_items: Collection<int, OddsItem>}
*/
public function resolve(string $playCode, string $currencyCode): array
{
$playType = PlayType::query()->where('play_code', $playCode)->first();
if ($playType === null) {
throw new TicketOperationException('play_not_found', ErrorCode::BetPlayUnsupported->value);
}
if (! $playType->is_enabled) {
throw new TicketOperationException('play_master_disabled', ErrorCode::PlayModeClosed->value);
}
$playVersion = PlayConfigVersion::query()
->where('status', ConfigVersionStatus::Active->value)
->firstOrFail();
@@ -120,7 +111,6 @@ final class PlayCatalogResolver
}
return [
'play_type' => $playType,
'play_config' => $playConfig,
'odds_items' => $oddsItems,
];