<?php

/**
 * Operations module routes.
 * @var \CodeIgniter\Router\RouteCollection $routes
 */

$routes->group('operations', ['filter' => 'auth'], static function ($routes) {
    $routes->get('/', '\Modules\Operations\Controllers\OperationsDashboardController::index', [
        'filter' => 'permission:operations.view',
    ]);
});

$routes->group('operations/work-orders', ['filter' => 'auth'], static function ($routes) {
    $routes->get('create', '\Modules\Operations\Controllers\WorkOrderController::createForm', [
        'filter' => 'permission:work_orders.create',
    ]);
    $routes->post('/', '\Modules\Operations\Controllers\WorkOrderController::store', [
        'filter' => 'permission:work_orders.create',
    ]);

    $routes->get('assign-staff', '\Modules\Operations\Controllers\WorkOrderController::assignStaff', [
        'filter' => 'permission:work_orders.assign_staff',
    ]);
    $routes->post('assign-staff', '\Modules\Operations\Controllers\WorkOrderController::storeStaff', [
        'filter' => 'permission:work_orders.assign_staff',
    ]);
    $routes->post('staff/(:num)/remove', '\Modules\Operations\Controllers\WorkOrderController::removeStaff/$1', [
        'filter' => 'permission:work_orders.assign_staff',
    ]);

    $routes->get('assign-equipment', '\Modules\Operations\Controllers\WorkOrderController::assignEquipment', [
        'filter' => 'permission:work_orders.assign_equipment',
    ]);
    $routes->post('assign-equipment', '\Modules\Operations\Controllers\WorkOrderController::storeEquipment', [
        'filter' => 'permission:work_orders.assign_equipment',
    ]);
    $routes->post('equipment/(:num)/return', '\Modules\Operations\Controllers\WorkOrderController::returnEquipment/$1', [
        'filter' => 'permission:work_orders.assign_equipment',
    ]);
    $routes->post('equipment/(:num)/remove', '\Modules\Operations\Controllers\WorkOrderController::removeEquipment/$1', [
        'filter' => 'permission:work_orders.assign_equipment',
    ]);

    $routes->get('status-tracking', '\Modules\Operations\Controllers\WorkOrderController::statusTracking', [
        'filter' => 'permission:work_orders.view',
    ]);
    $routes->post('(:num)/status', '\Modules\Operations\Controllers\WorkOrderController::updateStatus/$1', [
        'filter' => 'permission:work_orders.edit',
    ]);

    $routes->get('completion-reports', '\Modules\Operations\Controllers\WorkOrderController::completionReports', [
        'filter' => 'permission:work_orders.view',
    ]);

    $routes->get('(:num)', '\Modules\Operations\Controllers\WorkOrderController::show/$1', [
        'filter' => 'permission:work_orders.view',
    ]);
    $routes->get('(:num)/edit', '\Modules\Operations\Controllers\WorkOrderController::editForm/$1', [
        'filter' => 'permission:work_orders.edit',
    ]);
    $routes->post('(:num)', '\Modules\Operations\Controllers\WorkOrderController::update/$1', [
        'filter' => 'permission:work_orders.edit',
    ]);
    $routes->post('(:num)/submit', '\Modules\Operations\Controllers\WorkOrderController::submitForApproval/$1', [
        'filter' => 'permission:work_orders.edit',
    ]);
    $routes->post('(:num)/complete', '\Modules\Operations\Controllers\WorkOrderController::complete/$1', [
        'filter' => 'permission:work_orders.complete',
    ]);
    $routes->post('(:num)/cancel', '\Modules\Operations\Controllers\WorkOrderController::cancel/$1', [
        'filter' => 'permission:work_orders.edit',
    ]);
    $routes->post('(:num)/delete', '\Modules\Operations\Controllers\WorkOrderController::destroy/$1', [
        'filter' => 'permission:work_orders.delete',
    ]);
});

$routes->group('operations/tasks', ['filter' => 'auth'], static function ($routes) {
    $routes->get('/', '\Modules\Operations\Controllers\OperationsTaskController::index', [
        'filter' => 'permission:operations_tasks.view',
    ]);
    $routes->get('create', '\Modules\Operations\Controllers\OperationsTaskController::createForm', [
        'filter' => 'permission:operations_tasks.create',
    ]);
    $routes->post('/', '\Modules\Operations\Controllers\OperationsTaskController::store', [
        'filter' => 'permission:operations_tasks.create',
    ]);

    $routes->get('checklists', '\Modules\Operations\Controllers\OperationsTaskController::checklists', [
        'filter' => 'permission:operations_tasks.view',
    ]);
    $routes->post('checklists', '\Modules\Operations\Controllers\OperationsTaskController::storeChecklistItem', [
        'filter' => 'permission:operations_tasks.edit',
    ]);
    $routes->post('checklist/(:num)/toggle', '\Modules\Operations\Controllers\OperationsTaskController::toggleChecklistItem/$1', [
        'filter' => 'permission:operations_tasks.edit',
    ]);
    $routes->post('checklist/(:num)/remove', '\Modules\Operations\Controllers\OperationsTaskController::removeChecklistItem/$1', [
        'filter' => 'permission:operations_tasks.edit',
    ]);

    $routes->get('priorities', '\Modules\Operations\Controllers\OperationsTaskController::priorities', [
        'filter' => 'permission:operations_tasks.view',
    ]);
    $routes->get('deadlines', '\Modules\Operations\Controllers\OperationsTaskController::deadlines', [
        'filter' => 'permission:operations_tasks.view',
    ]);

    $routes->get('(:num)', '\Modules\Operations\Controllers\OperationsTaskController::show/$1', [
        'filter' => 'permission:operations_tasks.view',
    ]);
    $routes->get('(:num)/edit', '\Modules\Operations\Controllers\OperationsTaskController::editForm/$1', [
        'filter' => 'permission:operations_tasks.edit',
    ]);
    $routes->post('(:num)', '\Modules\Operations\Controllers\OperationsTaskController::update/$1', [
        'filter' => 'permission:operations_tasks.edit',
    ]);
    $routes->post('(:num)/complete', '\Modules\Operations\Controllers\OperationsTaskController::complete/$1', [
        'filter' => 'permission:operations_tasks.edit',
    ]);
    $routes->post('(:num)/cancel', '\Modules\Operations\Controllers\OperationsTaskController::cancel/$1', [
        'filter' => 'permission:operations_tasks.edit',
    ]);
    $routes->post('(:num)/delete', '\Modules\Operations\Controllers\OperationsTaskController::destroy/$1', [
        'filter' => 'permission:operations_tasks.delete',
    ]);
});

$routes->group('operations/field-service', ['filter' => 'auth'], static function ($routes) {
    // Service visits
    $routes->get('service-visits', '\Modules\Operations\Controllers\FieldServiceController::indexVisits', [
        'filter' => 'permission:field_service.view',
    ]);
    $routes->get('service-visits/create', '\Modules\Operations\Controllers\FieldServiceController::createVisitForm', [
        'filter' => 'permission:field_service.create',
    ]);
    $routes->post('service-visits', '\Modules\Operations\Controllers\FieldServiceController::storeVisit', [
        'filter' => 'permission:field_service.create',
    ]);
    $routes->get('service-visits/(:num)', '\Modules\Operations\Controllers\FieldServiceController::showVisit/$1', [
        'filter' => 'permission:field_service.view',
    ]);
    $routes->get('service-visits/(:num)/edit', '\Modules\Operations\Controllers\FieldServiceController::editVisitForm/$1', [
        'filter' => 'permission:field_service.edit',
    ]);
    $routes->post('service-visits/(:num)', '\Modules\Operations\Controllers\FieldServiceController::updateVisit/$1', [
        'filter' => 'permission:field_service.edit',
    ]);
    $routes->post('service-visits/(:num)/complete', '\Modules\Operations\Controllers\FieldServiceController::completeVisit/$1', [
        'filter' => 'permission:field_service.edit',
    ]);
    $routes->post('service-visits/(:num)/cancel', '\Modules\Operations\Controllers\FieldServiceController::cancelVisit/$1', [
        'filter' => 'permission:field_service.edit',
    ]);
    $routes->post('service-visits/(:num)/en-route', '\Modules\Operations\Controllers\FieldServiceController::enRouteVisit/$1', [
        'filter' => 'permission:field_service.edit',
    ]);
    $routes->post('service-visits/(:num)/on-site', '\Modules\Operations\Controllers\FieldServiceController::onSiteVisit/$1', [
        'filter' => 'permission:field_service.edit',
    ]);
    $routes->post('service-visits/(:num)/delete', '\Modules\Operations\Controllers\FieldServiceController::destroyVisit/$1', [
        'filter' => 'permission:field_service.delete',
    ]);

    // Technician jobs
    $routes->get('technician-jobs', '\Modules\Operations\Controllers\FieldServiceController::indexJobs', [
        'filter' => 'permission:field_service.view',
    ]);
    $routes->get('technician-jobs/create', '\Modules\Operations\Controllers\FieldServiceController::createJobForm', [
        'filter' => 'permission:field_service.create',
    ]);
    $routes->post('technician-jobs', '\Modules\Operations\Controllers\FieldServiceController::storeJob', [
        'filter' => 'permission:field_service.create',
    ]);
    $routes->get('technician-jobs/(:num)', '\Modules\Operations\Controllers\FieldServiceController::showJob/$1', [
        'filter' => 'permission:field_service.view',
    ]);
    $routes->get('technician-jobs/(:num)/edit', '\Modules\Operations\Controllers\FieldServiceController::editJobForm/$1', [
        'filter' => 'permission:field_service.edit',
    ]);
    $routes->post('technician-jobs/(:num)', '\Modules\Operations\Controllers\FieldServiceController::updateJob/$1', [
        'filter' => 'permission:field_service.edit',
    ]);
    $routes->post('technician-jobs/(:num)/start', '\Modules\Operations\Controllers\FieldServiceController::startJob/$1', [
        'filter' => 'permission:field_service.edit',
    ]);
    $routes->post('technician-jobs/(:num)/complete', '\Modules\Operations\Controllers\FieldServiceController::completeJob/$1', [
        'filter' => 'permission:field_service.edit',
    ]);
    $routes->post('technician-jobs/(:num)/cancel', '\Modules\Operations\Controllers\FieldServiceController::cancelJob/$1', [
        'filter' => 'permission:field_service.edit',
    ]);
    $routes->post('technician-jobs/(:num)/delete', '\Modules\Operations\Controllers\FieldServiceController::destroyJob/$1', [
        'filter' => 'permission:field_service.delete',
    ]);

    // Inspection reports
    $routes->get('inspection-reports', '\Modules\Operations\Controllers\FieldServiceController::indexReports', [
        'filter' => 'permission:field_service.view',
    ]);
    $routes->get('inspection-reports/create', '\Modules\Operations\Controllers\FieldServiceController::createReportForm', [
        'filter' => 'permission:field_service.create',
    ]);
    $routes->post('inspection-reports', '\Modules\Operations\Controllers\FieldServiceController::storeReport', [
        'filter' => 'permission:field_service.create',
    ]);
    $routes->get('inspection-reports/(:num)', '\Modules\Operations\Controllers\FieldServiceController::showReport/$1', [
        'filter' => 'permission:field_service.view',
    ]);
    $routes->get('inspection-reports/(:num)/edit', '\Modules\Operations\Controllers\FieldServiceController::editReportForm/$1', [
        'filter' => 'permission:field_service.edit',
    ]);
    $routes->post('inspection-reports/(:num)', '\Modules\Operations\Controllers\FieldServiceController::updateReport/$1', [
        'filter' => 'permission:field_service.edit',
    ]);
    $routes->post('inspection-reports/(:num)/submit', '\Modules\Operations\Controllers\FieldServiceController::submitReport/$1', [
        'filter' => 'permission:field_service.edit',
    ]);
    $routes->post('inspection-reports/(:num)/approve', '\Modules\Operations\Controllers\FieldServiceController::approveReport/$1', [
        'filter' => 'permission:field_service.edit',
    ]);
    $routes->post('inspection-reports/(:num)/reject', '\Modules\Operations\Controllers\FieldServiceController::rejectReport/$1', [
        'filter' => 'permission:field_service.edit',
    ]);
    $routes->post('inspection-reports/(:num)/delete', '\Modules\Operations\Controllers\FieldServiceController::destroyReport/$1', [
        'filter' => 'permission:field_service.delete',
    ]);

    // Customer signatures
    $routes->get('customer-signatures', '\Modules\Operations\Controllers\FieldServiceController::indexSignatures', [
        'filter' => 'permission:field_service.view',
    ]);
    $routes->get('customer-signatures/create', '\Modules\Operations\Controllers\FieldServiceController::createSignatureForm', [
        'filter' => 'permission:field_service.create',
    ]);
    $routes->post('customer-signatures', '\Modules\Operations\Controllers\FieldServiceController::storeSignature', [
        'filter' => 'permission:field_service.create',
    ]);
    $routes->get('customer-signatures/(:num)', '\Modules\Operations\Controllers\FieldServiceController::showSignature/$1', [
        'filter' => 'permission:field_service.view',
    ]);
    $routes->get('customer-signatures/(:num)/edit', '\Modules\Operations\Controllers\FieldServiceController::editSignatureForm/$1', [
        'filter' => 'permission:field_service.edit',
    ]);
    $routes->post('customer-signatures/(:num)', '\Modules\Operations\Controllers\FieldServiceController::updateSignature/$1', [
        'filter' => 'permission:field_service.edit',
    ]);
    $routes->post('customer-signatures/(:num)/void', '\Modules\Operations\Controllers\FieldServiceController::voidSignature/$1', [
        'filter' => 'permission:field_service.edit',
    ]);
    $routes->post('customer-signatures/(:num)/delete', '\Modules\Operations\Controllers\FieldServiceController::destroySignature/$1', [
        'filter' => 'permission:field_service.delete',
    ]);
});

$routes->group('operations/quality-control', ['filter' => 'auth'], static function ($routes) {
    // Inspections
    $routes->get('inspections', '\Modules\Operations\Controllers\QualityControlController::index', [
        'filter' => 'permission:quality_control.view',
    ]);
    $routes->get('inspections/create', '\Modules\Operations\Controllers\QualityControlController::createForm', [
        'filter' => 'permission:quality_control.create',
    ]);
    $routes->post('inspections', '\Modules\Operations\Controllers\QualityControlController::store', [
        'filter' => 'permission:quality_control.create',
    ]);
    $routes->get('inspections/(:num)', '\Modules\Operations\Controllers\QualityControlController::show/$1', [
        'filter' => 'permission:quality_control.view',
    ]);
    $routes->get('inspections/(:num)/edit', '\Modules\Operations\Controllers\QualityControlController::editForm/$1', [
        'filter' => 'permission:quality_control.edit',
    ]);
    $routes->post('inspections/(:num)', '\Modules\Operations\Controllers\QualityControlController::update/$1', [
        'filter' => 'permission:quality_control.edit',
    ]);
    $routes->post('inspections/(:num)/complete', '\Modules\Operations\Controllers\QualityControlController::complete/$1', [
        'filter' => 'permission:quality_control.edit',
    ]);
    $routes->post('inspections/(:num)/cancel', '\Modules\Operations\Controllers\QualityControlController::cancel/$1', [
        'filter' => 'permission:quality_control.edit',
    ]);
    $routes->post('inspections/(:num)/delete', '\Modules\Operations\Controllers\QualityControlController::destroy/$1', [
        'filter' => 'permission:quality_control.delete',
    ]);

    // Audit checklists
    $routes->get('audit-checklists', '\Modules\Operations\Controllers\QualityControlController::indexChecklists', [
        'filter' => 'permission:quality_control.view',
    ]);
    $routes->get('audit-checklists/create', '\Modules\Operations\Controllers\QualityControlController::createChecklistForm', [
        'filter' => 'permission:quality_control.create',
    ]);
    $routes->post('audit-checklists', '\Modules\Operations\Controllers\QualityControlController::storeChecklist', [
        'filter' => 'permission:quality_control.create',
    ]);
    $routes->get('audit-checklists/(:num)', '\Modules\Operations\Controllers\QualityControlController::showChecklist/$1', [
        'filter' => 'permission:quality_control.view',
    ]);
    $routes->get('audit-checklists/(:num)/edit', '\Modules\Operations\Controllers\QualityControlController::editChecklistForm/$1', [
        'filter' => 'permission:quality_control.edit',
    ]);
    $routes->post('audit-checklists/(:num)', '\Modules\Operations\Controllers\QualityControlController::updateChecklist/$1', [
        'filter' => 'permission:quality_control.edit',
    ]);
    $routes->post('audit-checklists/(:num)/delete', '\Modules\Operations\Controllers\QualityControlController::destroyChecklist/$1', [
        'filter' => 'permission:quality_control.delete',
    ]);
    $routes->post('audit-checklists/items', '\Modules\Operations\Controllers\QualityControlController::addChecklistItem', [
        'filter' => 'permission:quality_control.edit',
    ]);
    $routes->post('audit-checklists/items/(:num)/toggle', '\Modules\Operations\Controllers\QualityControlController::toggleChecklistItem/$1', [
        'filter' => 'permission:quality_control.edit',
    ]);
    $routes->post('audit-checklists/items/(:num)/remove', '\Modules\Operations\Controllers\QualityControlController::removeChecklistItem/$1', [
        'filter' => 'permission:quality_control.edit',
    ]);

    // Performance scores
    $routes->get('performance-scores', '\Modules\Operations\Controllers\QualityControlController::indexScores', [
        'filter' => 'permission:quality_control.view',
    ]);
    $routes->get('performance-scores/create', '\Modules\Operations\Controllers\QualityControlController::createScoreForm', [
        'filter' => 'permission:quality_control.create',
    ]);
    $routes->post('performance-scores', '\Modules\Operations\Controllers\QualityControlController::storeScore', [
        'filter' => 'permission:quality_control.create',
    ]);
    $routes->get('performance-scores/(:num)', '\Modules\Operations\Controllers\QualityControlController::showScore/$1', [
        'filter' => 'permission:quality_control.view',
    ]);
    $routes->get('performance-scores/(:num)/edit', '\Modules\Operations\Controllers\QualityControlController::editScoreForm/$1', [
        'filter' => 'permission:quality_control.edit',
    ]);
    $routes->post('performance-scores/(:num)', '\Modules\Operations\Controllers\QualityControlController::updateScore/$1', [
        'filter' => 'permission:quality_control.edit',
    ]);
    $routes->post('performance-scores/(:num)/publish', '\Modules\Operations\Controllers\QualityControlController::publishScore/$1', [
        'filter' => 'permission:quality_control.edit',
    ]);
    $routes->post('performance-scores/(:num)/delete', '\Modules\Operations\Controllers\QualityControlController::destroyScore/$1', [
        'filter' => 'permission:quality_control.delete',
    ]);
});

$routes->group('operations/resources', ['filter' => 'auth'], static function ($routes) {
    // Staff allocation
    $routes->get('staff-allocation', '\Modules\Operations\Controllers\OperationsResourcesController::staffAllocation', [
        'filter' => 'permission:operations_resources.view',
    ]);
    $routes->get('staff-allocation/create', '\Modules\Operations\Controllers\OperationsResourcesController::createStaffForm', [
        'filter' => 'permission:operations_resources.create',
    ]);
    $routes->post('staff-allocation', '\Modules\Operations\Controllers\OperationsResourcesController::storeStaff', [
        'filter' => 'permission:operations_resources.create',
    ]);
    $routes->get('staff-allocation/(:num)', '\Modules\Operations\Controllers\OperationsResourcesController::showStaff/$1', [
        'filter' => 'permission:operations_resources.view',
    ]);
    $routes->get('staff-allocation/(:num)/edit', '\Modules\Operations\Controllers\OperationsResourcesController::editStaffForm/$1', [
        'filter' => 'permission:operations_resources.edit',
    ]);
    $routes->post('staff-allocation/(:num)', '\Modules\Operations\Controllers\OperationsResourcesController::updateStaff/$1', [
        'filter' => 'permission:operations_resources.edit',
    ]);
    $routes->post('staff-allocation/(:num)/activate', '\Modules\Operations\Controllers\OperationsResourcesController::activateStaff/$1', [
        'filter' => 'permission:operations_resources.edit',
    ]);
    $routes->post('staff-allocation/(:num)/release', '\Modules\Operations\Controllers\OperationsResourcesController::releaseStaff/$1', [
        'filter' => 'permission:operations_resources.edit',
    ]);
    $routes->post('staff-allocation/(:num)/delete', '\Modules\Operations\Controllers\OperationsResourcesController::destroyStaff/$1', [
        'filter' => 'permission:operations_resources.delete',
    ]);

    // Equipment allocation
    $routes->get('equipment-allocation', '\Modules\Operations\Controllers\OperationsResourcesController::equipmentAllocation', [
        'filter' => 'permission:operations_resources.view',
    ]);
    $routes->get('equipment-allocation/create', '\Modules\Operations\Controllers\OperationsResourcesController::createEquipmentForm', [
        'filter' => 'permission:operations_resources.create',
    ]);
    $routes->post('equipment-allocation', '\Modules\Operations\Controllers\OperationsResourcesController::storeEquipment', [
        'filter' => 'permission:operations_resources.create',
    ]);
    $routes->get('equipment-allocation/(:num)', '\Modules\Operations\Controllers\OperationsResourcesController::showEquipment/$1', [
        'filter' => 'permission:operations_resources.view',
    ]);
    $routes->get('equipment-allocation/(:num)/edit', '\Modules\Operations\Controllers\OperationsResourcesController::editEquipmentForm/$1', [
        'filter' => 'permission:operations_resources.edit',
    ]);
    $routes->post('equipment-allocation/(:num)', '\Modules\Operations\Controllers\OperationsResourcesController::updateEquipment/$1', [
        'filter' => 'permission:operations_resources.edit',
    ]);
    $routes->post('equipment-allocation/(:num)/return', '\Modules\Operations\Controllers\OperationsResourcesController::returnEquipment/$1', [
        'filter' => 'permission:operations_resources.edit',
    ]);
    $routes->post('equipment-allocation/(:num)/lost', '\Modules\Operations\Controllers\OperationsResourcesController::markLost/$1', [
        'filter' => 'permission:operations_resources.edit',
    ]);
    $routes->post('equipment-allocation/(:num)/delete', '\Modules\Operations\Controllers\OperationsResourcesController::destroyEquipment/$1', [
        'filter' => 'permission:operations_resources.delete',
    ]);

    // Material usage
    $routes->get('material-usage', '\Modules\Operations\Controllers\OperationsResourcesController::materialUsage', [
        'filter' => 'permission:operations_resources.view',
    ]);
    $routes->get('material-usage/create', '\Modules\Operations\Controllers\OperationsResourcesController::createMaterialForm', [
        'filter' => 'permission:operations_resources.create',
    ]);
    $routes->post('material-usage', '\Modules\Operations\Controllers\OperationsResourcesController::storeMaterial', [
        'filter' => 'permission:operations_resources.create',
    ]);
    $routes->get('material-usage/(:num)', '\Modules\Operations\Controllers\OperationsResourcesController::showMaterial/$1', [
        'filter' => 'permission:operations_resources.view',
    ]);
    $routes->get('material-usage/(:num)/edit', '\Modules\Operations\Controllers\OperationsResourcesController::editMaterialForm/$1', [
        'filter' => 'permission:operations_resources.edit',
    ]);
    $routes->post('material-usage/(:num)', '\Modules\Operations\Controllers\OperationsResourcesController::updateMaterial/$1', [
        'filter' => 'permission:operations_resources.edit',
    ]);
    $routes->post('material-usage/(:num)/void', '\Modules\Operations\Controllers\OperationsResourcesController::voidUsage/$1', [
        'filter' => 'permission:operations_resources.edit',
    ]);
    $routes->post('material-usage/(:num)/delete', '\Modules\Operations\Controllers\OperationsResourcesController::destroyMaterial/$1', [
        'filter' => 'permission:operations_resources.delete',
    ]);
});

$routes->group('operations/approvals', ['filter' => 'auth'], static function ($routes) {
    $routes->get('requests/create', '\Modules\Operations\Controllers\OperationsApprovalRequestController::createForm', [
        'filter' => 'permission:operations_approvals.create',
    ]);
    $routes->post('requests', '\Modules\Operations\Controllers\OperationsApprovalRequestController::store', [
        'filter' => 'permission:operations_approvals.create',
    ]);
    $routes->get('my-requests', '\Modules\Operations\Controllers\OperationsApprovalRequestController::myRequests', [
        'filter' => 'permission:operations_approvals.view',
    ]);
    $routes->get('inbox', '\Modules\Operations\Controllers\OperationsApprovalRequestController::inbox', [
        'filter' => 'permission:operations_approvals.decide',
    ]);
    $routes->get('requests/(:num)', '\Modules\Operations\Controllers\OperationsApprovalRequestController::show/$1');
    $routes->post('requests/(:num)/approve', '\Modules\Operations\Controllers\OperationsApprovalRequestController::approve/$1', [
        'filter' => ['permission:operations_approvals.decide', 'tpin'],
    ]);
    $routes->post('requests/(:num)/reject', '\Modules\Operations\Controllers\OperationsApprovalRequestController::reject/$1', [
        'filter' => ['permission:operations_approvals.decide', 'tpin'],
    ]);
    $routes->post('requests/(:num)/cancel', '\Modules\Operations\Controllers\OperationsApprovalRequestController::cancel/$1', [
        'filter' => 'permission:operations_approvals.create',
    ]);

    $routes->get('expenses', '\Modules\Operations\Controllers\OperationsApprovalController::expenses', [
        'filter' => 'permission:expenses.approve',
    ]);
    $routes->post('expenses/approve', '\Modules\Operations\Controllers\OperationsApprovalController::approveExpense', [
        'filter' => ['permission:expenses.approve', 'tpin'],
    ]);

    $routes->get('work-orders', '\Modules\Operations\Controllers\OperationsApprovalController::workOrders', [
        'filter' => 'permission:work_orders.approve',
    ]);
    $routes->post('work-orders/approve', '\Modules\Operations\Controllers\OperationsApprovalController::approveWorkOrder', [
        'filter' => ['permission:work_orders.approve', 'tpin'],
    ]);
    $routes->post('work-orders/reject', '\Modules\Operations\Controllers\OperationsApprovalController::rejectWorkOrder', [
        'filter' => ['permission:work_orders.approve', 'tpin'],
    ]);

    $routes->get('purchases', '\Modules\Operations\Controllers\OperationsApprovalController::purchases', [
        'filter' => 'permission:procurement.approve',
    ]);
    $routes->post('purchases/approve', '\Modules\Operations\Controllers\OperationsApprovalController::approvePurchase', [
        'filter' => ['permission:procurement.approve', 'tpin'],
    ]);
    $routes->post('purchases/reject', '\Modules\Operations\Controllers\OperationsApprovalController::rejectPurchase', [
        'filter' => ['permission:procurement.approve', 'tpin'],
    ]);

    $routes->get('leave', '\Modules\Operations\Controllers\OperationsApprovalController::leave', [
        'filter' => 'permission:leave_requests.approve',
    ]);
    $routes->post('leave/approve', '\Modules\Operations\Controllers\OperationsApprovalController::approveLeave', [
        'filter' => ['permission:leave_requests.approve', 'tpin'],
    ]);
    $routes->post('leave/reject', '\Modules\Operations\Controllers\OperationsApprovalController::rejectLeave', [
        'filter' => ['permission:leave_requests.approve', 'tpin'],
    ]);
});
