<?php

use App\Http\Controllers\PaymentController;
use Illuminate\Support\Facades\Route;

Route::get('/payment',  [PaymentController::class, 'index'])->middleware('permission:payment,view');
Route::post('/payment', [PaymentController::class, 'store'])->middleware('permission:payment,add');

Route::get('/payment/platform-fees',            [PaymentController::class, 'platformFees']);
Route::get('/payment/schedule/{schedule}/pix',  [PaymentController::class, 'getSchedulePix'])->middleware('permission:config.schedule,view');
Route::post('/payment/schedule/{schedule}/pay', [PaymentController::class, 'paySchedule'])->middleware('permission:config.schedule,edit');

Route::get('/payment/{id}',    [PaymentController::class, 'show'])->middleware('permission:payment,view');
Route::put('/payment/{id}',    [PaymentController::class, 'update'])->middleware('permission:payment,edit');
Route::delete('/payment/{id}', [PaymentController::class, 'destroy'])->middleware('permission:payment,delete');
