<?php

use Illuminate\Support\Facades\Route;
use App\Http\Controllers\Api\V1\Admin\Jackpot\AdminJackpotPoolIndexController;
use App\Http\Controllers\Api\V1\Admin\Jackpot\AdminJackpotPoolUpdateController;
use App\Http\Controllers\Api\V1\Admin\Jackpot\AdminJackpotPoolAdjustController;
use App\Http\Controllers\Api\V1\Admin\Jackpot\AdminJackpotPoolManualBurstController;
use App\Http\Controllers\Api\V1\Admin\Jackpot\AdminJackpotPayoutLogIndexController;
use App\Http\Controllers\Api\V1\Admin\Jackpot\AdminJackpotContributionIndexController;
use App\Http\Controllers\Api\V1\Admin\Jackpot\AdminJackpotPoolAdjustmentIndexController;

/**
 * 管理员奖池管理路由。
 */

// 奖池查看
Route::middleware('admin.api-resource')
    ->group(function (): void {
        Route::get('jackpot/pools', AdminJackpotPoolIndexController::class)
            ->name('api.v1.admin.jackpot.pools.index');
        Route::get('jackpot/payout-logs', AdminJackpotPayoutLogIndexController::class)
            ->name('api.v1.admin.jackpot.payout-logs.index');
        Route::get('jackpot/contributions', AdminJackpotContributionIndexController::class)
            ->name('api.v1.admin.jackpot.contributions.index');
        Route::get('jackpot/pools/{pool}/adjustments', AdminJackpotPoolAdjustmentIndexController::class)
            ->name('api.v1.admin.jackpot.pools.adjustments.index');
    });

// 奖池修改（仅管理权限）
Route::middleware('admin.api-resource')
    ->group(function (): void {
        Route::put('jackpot/pools/{pool}', AdminJackpotPoolUpdateController::class)
            ->name('api.v1.admin.jackpot.pools.update');
        Route::post('jackpot/pools/{pool}/adjustments', AdminJackpotPoolAdjustController::class)
            ->name('api.v1.admin.jackpot.pools.adjustments.store');
        Route::post('jackpot/pools/{pool}/manual-burst', AdminJackpotPoolManualBurstController::class)
            ->name('api.v1.admin.jackpot.pools.manual-burst');
    });
