<?php

use Illuminate\Support\Facades\Route;

Route::group(['prefix' => 'transactions', 'namespace' => 'Transactions', 'as' => 'transaction.'], function () {

    Route::get('/list', 'ListTransactionsController@list')->name('list');
    Route::delete('/suspend/{id}', 'SuspendTransactionController@suspend')->name('suspend');

    route::post('/supplier/{id}/bill/create', 'CreateSupplierTransactionController@create')->name('supplier.create');
    route::post('{id}/bill/verification', 'CreatePaymentProofDocumentController@verify')->name('bill.verification');
    route::post('{id}/bill/pay', 'CreatePaymentProofDocumentController@pay')->name('bill.pay');
    Route::put('/{id}/bill/{status}', 'UpdatePaymentTransactionStatusController@update')->where('status', 'pending|complete')->name('bill.status');
    Route::put('/{id}/refund/status/update', 'UpdateRefundTransactionStatusController@update')->name('refund.status.update');

    route::delete('{id}/bill/delete', 'DeletePaymentProofDocumentController@delete')->name('bill.delete');

    Route::post('booking/{id}/details/update', 'CreatePurchaseOrderTransactionController@create')->name('po.create');
    
    Route::get('wallet/list', 'ListWalletTransactionsController@list')->name('wallet.list');

    Route::get('/company/{id}/account/balance', 'FetchCompanyAccountBalanceController@fetch')->name('company.account.balance');

    Route::get('/bank/{id}/account/balance', 'FetchBankAccountBalanceController@fetch')->name('bank.account.balance');

    Route::group(['prefix' => 'groups', 'as' => 'group.'], function () {
        Route::get('/list', 'ListGroupsController@list')->name('list');
        Route::delete('/{id}/delete', 'DeleteGroupController@delete')->name('delete');
        Route::put('/{id}/update', 'UpdateGroupController@update')->name('update');
    });
});