<?php

use Illuminate\Support\Facades\Route;
use Modules\Approval\Http\Controllers\ApprovalController;

Route::middleware(['api.auth'])->group(function () {
    Route::prefix('approval-requests')->scopeBindings()->name('approval-request.')->group(function () {
        Route::get('/', [ApprovalController::class, 'index'])->name('index');
        Route::get('my-pending',[ApprovalController::class, 'myPending'])->name('my-pending');
        Route::get('my-history',[ApprovalController::class, 'myHistory'])->name('my-history');
        Route::get('{approvalRequest}', [ApprovalController::class, 'show'])->name('show');
        Route::post('{approvalRequest}/approve', [ApprovalController::class, 'approve'])->name('approve');
        Route::post('{approvalRequest}/reject', [ApprovalController::class, 'reject'])->name('reject');

        // Have to do: Approval Workflows GET /approval-workflows Manage approval workflows and steps.
    });
});
