<?php

use Illuminate\Support\Facades\Route;

Route::group(['prefix' => 'wallets', 'namespace' => 'Wallets', 'as' => 'wallet.'], function () {
    Route::get('/', 'ListWalletController@list')->name('list');

    Route::get('/company-module/{company_module_id}', 'FetchWalletByCompanyModuleController@fetch')->name('company_module.show');

    Route::post('/create', 'CreateWalletController@create')->name('create');

    Route::post('/topup', 'TopUpWalletController@topUp')->name('topup'); // user
    Route::post('/credit', 'CreditWalletController@credit')->name('credit'); // admin +

    Route::put('/{transaction_id}/update-status/{status}', 'UpdateStatusWalletController@updateStatus')->where('status', 'approve|reject')->name('approval');

    Route::get('/reports', 'WalletReportController@walletsReport')->name('reports');
});
