<?php

use App\Http\Controllers\Wallets\CreateWalletController;
use App\Http\Controllers\Wallets\CreditWalletController;
use App\Http\Controllers\Wallets\ListWalletController;
use App\Http\Controllers\Wallets\TopUpWalletController;
use App\Http\Controllers\Wallets\UpdateStatusWalletController;
use App\Http\Controllers\Wallets\WalletReportController;
use Illuminate\Support\Facades\Route;

Route::group(['prefix' => 'wallets', 'as' => 'wallet.'], function () {
    Route::get('/', [ListWalletController::class, 'list'])->name('list');
    Route::post('/create', [CreateWalletController::class, 'create'])->name('create');

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

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

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