<?php

use Illuminate\Support\Facades\Route;
use App\Http\Controllers\Api\V1\Admin\AgentSettlement\AdminCreditLedgerIndexController;
use App\Http\Controllers\Api\V1\Admin\AgentSettlement\AgentSettlementBillShowController;
use App\Http\Controllers\Api\V1\Admin\AgentSettlement\AgentSettlementBillIndexController;
use App\Http\Controllers\Api\V1\Admin\AgentSettlement\AgentSettlementReportShowController;
use App\Http\Controllers\Api\V1\Admin\AgentSettlement\AgentSettlementBillConfirmController;
use App\Http\Controllers\Api\V1\Admin\AgentSettlement\AgentSettlementBillPaymentController;
use App\Http\Controllers\Api\V1\Admin\AgentSettlement\AgentSettlementPeriodCloseController;
use App\Http\Controllers\Api\V1\Admin\AgentSettlement\AgentSettlementPeriodIndexController;
use App\Http\Controllers\Api\V1\Admin\AgentSettlement\AgentSettlementPeriodStoreController;
use App\Http\Controllers\Api\V1\Admin\AgentSettlement\AgentSettlementReportIndexController;
use App\Http\Controllers\Api\V1\Admin\AgentSettlement\AgentSettlementPaymentIndexController;
use App\Http\Controllers\Api\V1\Admin\AgentSettlement\AgentSettlementBillAdjustmentController;
use App\Http\Controllers\Api\V1\Admin\AgentSettlement\AgentSettlementAdjustmentIndexController;
use App\Http\Controllers\Api\V1\Admin\AgentSettlement\AgentSettlementOperationsIndexController;
use App\Http\Controllers\Api\V1\Admin\AgentSettlement\AgentSettlementPeriodOpenHintsController;
use App\Http\Controllers\Api\V1\Admin\AgentSettlement\AgentSettlementBillBadDebtWriteOffController;

Route::middleware('admin.api-resource')
    ->group(function (): void {
        Route::get('settlement-periods/open-hints', AgentSettlementPeriodOpenHintsController::class)
            ->name('api.v1.admin.settlement-periods.open-hints');
        Route::get('settlement-periods', AgentSettlementPeriodIndexController::class)
            ->name('api.v1.admin.settlement-periods.index');
        Route::post('settlement-periods', AgentSettlementPeriodStoreController::class)
            ->name('api.v1.admin.settlement-periods.store');
        Route::post('settlement-periods/{settlement_period}/close', AgentSettlementPeriodCloseController::class)
            ->name('api.v1.admin.settlement-periods.close');
        Route::get('credit-ledger', AdminCreditLedgerIndexController::class)
            ->name('api.v1.admin.credit-ledger.index');
        Route::get('settlement-bills', AgentSettlementBillIndexController::class)
            ->name('api.v1.admin.settlement-bills.index');
        Route::get('settlement-operations', AgentSettlementOperationsIndexController::class)
            ->name('api.v1.admin.settlement-operations.index');
        Route::get('settlement-payments', AgentSettlementPaymentIndexController::class)
            ->name('api.v1.admin.settlement-payments.index');
        Route::get('settlement-adjustments', AgentSettlementAdjustmentIndexController::class)
            ->name('api.v1.admin.settlement-adjustments.index');
        Route::get('settlement-bills/{settlement_bill}', AgentSettlementBillShowController::class)
            ->name('api.v1.admin.settlement-bills.show');
        Route::post('settlement-bills/{settlement_bill}/confirm', AgentSettlementBillConfirmController::class)
            ->name('api.v1.admin.settlement-bills.confirm');
        Route::post('settlement-bills/{settlement_bill}/payments', AgentSettlementBillPaymentController::class)
            ->name('api.v1.admin.settlement-bills.payments');
        Route::post('settlement-bills/{settlement_bill}/adjustments', AgentSettlementBillAdjustmentController::class)
            ->name('api.v1.admin.settlement-bills.adjustments');
        Route::post('settlement-bills/{settlement_bill}/bad-debt-write-off', AgentSettlementBillBadDebtWriteOffController::class)
            ->name('api.v1.admin.settlement-bills.bad-debt-write-off');
        Route::get('settlement-reports/summary', AgentSettlementReportIndexController::class)
            ->name('api.v1.admin.settlement-reports.summary');
        Route::get('settlement-reports', AgentSettlementReportShowController::class)
            ->name('api.v1.admin.settlement-reports.show');
    });
