feat: 拆分开奖与结算审核流程,新增手动结果录入、重开和派彩审批接口

This commit is contained in:
2026-05-16 18:01:06 +08:00
parent 83046b402d
commit 4f143c7cb1
38 changed files with 1992 additions and 170 deletions

View File

@@ -0,0 +1,30 @@
<?php
namespace App\Http\Controllers\Api\V1\Admin\Settlement;
use App\Lottery\ErrorCode;
use App\Support\ApiResponse;
use App\Models\SettlementBatch;
use Illuminate\Http\JsonResponse;
use App\Http\Controllers\Controller;
use App\Services\Settlement\SettlementBatchWorkflowService;
final class AdminSettlementBatchPayoutController extends Controller
{
public function __construct(private readonly SettlementBatchWorkflowService $service) {}
public function __invoke(SettlementBatch $batch): JsonResponse
{
try {
$updated = $this->service->payout($batch);
} catch (\RuntimeException) {
return ApiResponse::error(trans('api.client_error'), ErrorCode::ClientHttpError->value, null, 409);
}
return ApiResponse::success([
'id' => (int) $updated->id,
'status' => $updated->status,
'paid_at' => $updated->paid_at?->toIso8601String(),
]);
}
}