feat: 增强奖池与钱包管理功能

更新 AdminJackpotPoolUpdateController 校验规则,禁止传入 current_amount。
优化 AdminRiskPoolManualStatusController:更新奖池状态后同步 Redis 状态。
在 TransferOrderReconcileController 中新增 completeCredit 方法,用于处理卡住的转账订单对账。
调整 TransferOrderListController:优化转账订单处理条件。
在 TicketItemsIndexController 中实现支持时区的日期筛选,提升日期处理准确性。
扩展 JackpotPool 模型,新增 adjustments 关联关系。
改进票据与钱包相关服务中的错误处理和事务管理。
This commit is contained in:
2026-05-26 14:58:41 +08:00
parent 48349e3302
commit c8c90e3e94
45 changed files with 1877 additions and 104 deletions

View File

@@ -4,8 +4,8 @@ namespace App\Services\Ticket;
use App\Models\Draw;
use App\Lottery\ErrorCode;
use App\Lottery\DrawStatus;
use App\Exceptions\TicketOperationException;
use App\Services\Draw\DrawHallSnapshotBuilder;
final class TicketPreviewService
{
@@ -13,6 +13,7 @@ final class TicketPreviewService
private readonly PlayCatalogResolver $catalogResolver,
private readonly PlayRuleEngine $ruleEngine,
private readonly RiskPoolService $riskPoolService,
private readonly DrawHallSnapshotBuilder $drawHallSnapshot,
) {}
/**
@@ -25,7 +26,7 @@ final class TicketPreviewService
if ($draw === null) {
throw new TicketOperationException('draw_not_found', ErrorCode::BetInvalidDraw->value);
}
if ($draw->status !== DrawStatus::Open->value || ($draw->close_time !== null && now()->greaterThanOrEqualTo($draw->close_time))) {
if (! $this->drawHallSnapshot->isBettingOpen($draw)) {
throw new TicketOperationException('draw_closed', ErrorCode::DrawClosed->value);
}
@@ -108,10 +109,13 @@ final class TicketPreviewService
);
}
$nowUtc = now()->utc();
return [
'draw' => [
'draw_id' => $draw->draw_no,
'status' => $draw->status,
'status' => $this->drawHallSnapshot->effectiveHallDisplayStatus($draw, $nowUtc),
'db_status' => $draw->status,
],
'config_versions' => $this->catalogResolver->currentActiveVersionStamp(),
'summary' => [