<?php

use Illuminate\Support\Facades\Route;
use Modules\Jiesuan\Http\Controllers\BankAccountController;
use Modules\Jiesuan\Http\Controllers\FinanceCheckController;
use Modules\Jiesuan\Http\Controllers\JiesuanController;


Route::prefix('jiesuanManage')->group(function () {
    Route::prefix('bankAccount')->group(function (){
        Route::get('hezuoInfo', [BankAccountController::class, 'hezuoInfo']);
        Route::get('listCompanyCard', [BankAccountController::class, 'listCompanyCard']);
        Route::get('listAvailableBankCard', [BankAccountController::class, 'listAvailableBankCard']);
        Route::get('listBank', [BankAccountController::class, 'listBank']);
        Route::get('listShangwu', [BankAccountController::class, 'listShangwu']);
        Route::post('addCompanyCard', [BankAccountController::class, 'addCompanyCard'])->middleware(['roleCheck:company']);
        Route::post('delCompanyCard', [BankAccountController::class, 'delCompanyCard'])->middleware(['roleCheck:company']);
    });

    Route::prefix('jiesuan')->group(function(){
        Route::get('listTixian', [JiesuanController::class, 'listTixian']);
        Route::get('list', [JiesuanController::class, 'list']);
        Route::get('accountInfo', [JiesuanController::class, 'accountInfo']);
        Route::post('tixian', [JiesuanController::class, 'tixian'])->middleware(['roleCheck:company']);
        Route::post('updateTicket/{id}', [JiesuanController::class, 'updateTicket']);
    });

    Route::prefix('financeCheck')->group(function(){
       Route::get('list', [FinanceCheckController::class, 'list'])->middleware(['roleCheck:financer']);
       Route::post('check', [FinanceCheckController::class, 'check'])->middleware(['roleCheck:financer']);
       Route::post('remit', [FinanceCheckController::class, 'remit'])->middleware(['roleCheck:financer']);
       Route::get('getShanghuAccountInfo', [FinanceCheckController::class, 'getShanghuAccountInfo'])->middleware(['roleCheck:financer']);
    });

    // 结算账户审核
    Route::prefix('verify')->group(function (){
        Route::any('list',[\Modules\Jiesuan\Http\Controllers\VerifyBankInfoController::class,"list"]);
        // 商户选择项
        Route::any('business/option',[\Modules\Jiesuan\Http\Controllers\VerifyBankInfoController::class,"businessOption"]);
        Route::any('check',[\Modules\Jiesuan\Http\Controllers\VerifyBankInfoController::class,"check"])->middleware(['roleCheck:financer,administrator']);
    });
});

