<?php

use App\Http\Controllers\Accounting\ApproveDuplicateBankStatementDetailsStatusController;
use App\Http\Controllers\Accounting\BankStatementController;
use App\Http\Controllers\Accounting\GroupApproveStatementTransactionController;
use App\Http\Controllers\Accounting\HistoryImportedTransactionMappedController;
use App\Http\Controllers\Accounting\UpdateStatementTransactionStatusController;
use Illuminate\Support\Facades\Route;

Route::group(['prefix' => 'accounting', 'as' => 'accounting.'], function () {
    Route::post('/import', [BankStatementController::class, 'import'])->name('statement.import');
    Route::get('/bank_account', [BankStatementController::class, 'transactions'])->name('bank.transaction');
    Route::group(['prefix' => 'statements/{id}', 'as' => 'statement.'], function () {
        Route::get('/details', [BankStatementController::class, 'fetch'])->name('details');
        Route::put('/details/update', [BankStatementController::class, 'update'])->name('details.update');
    });

    Route::post('bankStatement/{id}/details/{status}', [ApproveDuplicateBankStatementDetailsStatusController::class, 'update'])->where('status', 'approve|reject|pending_verification')->name('bankStatement.details.status.update');

    Route::group(['prefix' => 'statement_transaction', 'as' => 'statement_transaction.'], function () {
        Route::post('/owner/group-approve', [GroupApproveStatementTransactionController::class, 'approve'])->name('owner.groupApprove');
        Route::post('/{id}/owner/{status}', [UpdateStatementTransactionStatusController::class, 'update'])->where('status', 'approve|reject')->name('owner.status.update');
    });

    Route::get('history/imported', [HistoryImportedTransactionMappedController::class, 'getImported'])->name('history.imported');

});
