<?php

use App\Http\Controllers\ProviderController;
use App\Http\Controllers\ProviderWithdrawalController;
use Illuminate\Support\Facades\Route;

Route::get('/provider/pending',                   [ProviderController::class, 'pending'])->middleware('permission:config.provider,view');
Route::patch('/provider/{id}/approve',            [ProviderController::class, 'approve'])->middleware('permission:config.provider,edit');
Route::patch('/provider/{id}/reject',             [ProviderController::class, 'reject'])->middleware('permission:config.provider,edit');
Route::get('/provider/payment-splits',            [ProviderWithdrawalController::class, 'splits'])->middleware('permission:config.provider,view');
Route::get('/provider-withdrawals',               [ProviderWithdrawalController::class, 'all'])->middleware('permission:payment,view');
Route::get('/provider/withdrawals/balance',       [ProviderWithdrawalController::class, 'balance'])->middleware('permission:config.provider,view');
Route::get('/provider/withdrawals/fees',          [ProviderWithdrawalController::class, 'fees'])->middleware('permission:config.provider,view');
Route::get('/provider/withdrawals',               [ProviderWithdrawalController::class, 'index'])->middleware('permission:config.provider,view');
Route::post('/provider/withdrawals',              [ProviderWithdrawalController::class, 'store'])->middleware('permission:config.provider,edit');
Route::get('/provider/withdrawals/{id}',          [ProviderWithdrawalController::class, 'show'])->middleware('permission:config.provider,view');
Route::get('/provider',                           [ProviderController::class, 'index'])->middleware('permission:config.provider,view');
Route::post('/provider',                          [ProviderController::class, 'store'])->middleware('permission:config.provider,add');
Route::get('/provider/{id}',                      [ProviderController::class, 'show'])->whereNumber('id')->middleware('permission:config.provider,view');
Route::put('/provider/{id}',                      [ProviderController::class, 'update'])->whereNumber('id')->middleware('permission:config.provider,edit');
Route::delete('/provider/{id}',                   [ProviderController::class, 'destroy'])->whereNumber('id')->middleware('permission:config.provider,delete');
