<?php
declare(strict_types=1);

return [
    // ── Dashboard ──
    ['GET',  '/procurement',                                  'Procurement\Controllers\ProcurementDashboardController@index',    ['auth'], 'procurement.dashboard'],

    // ── Purchase Requisitions ──
    ['GET',  '/procurement/requisitions',                     'Procurement\Controllers\RequisitionController@index',             ['auth'], 'procurement.pr.view'],
    ['GET',  '/procurement/requisitions/create',              'Procurement\Controllers\RequisitionController@create',            ['auth'], 'procurement.pr.create'],
    ['POST', '/procurement/requisitions',                     'Procurement\Controllers\RequisitionController@store',             ['auth', 'csrf'], 'procurement.pr.create'],
    ['GET',  '/procurement/requisitions/{id}',                'Procurement\Controllers\RequisitionController@show',              ['auth'], 'procurement.pr.view'],
    ['GET',  '/procurement/requisitions/{id}/edit',           'Procurement\Controllers\RequisitionController@edit',              ['auth'], 'procurement.pr.create'],
    ['POST', '/procurement/requisitions/{id}/update',         'Procurement\Controllers\RequisitionController@update',            ['auth', 'csrf'], 'procurement.pr.create'],
    ['POST', '/procurement/requisitions/{id}/submit',         'Procurement\Controllers\RequisitionController@submit',            ['auth', 'csrf'], 'procurement.pr.create'],
    ['POST', '/procurement/requisitions/{id}/approve',        'Procurement\Controllers\RequisitionController@approve',           ['auth', 'csrf'], 'procurement.pr.approve'],
    ['POST', '/procurement/requisitions/{id}/reject',         'Procurement\Controllers\RequisitionController@reject',            ['auth', 'csrf'], 'procurement.pr.approve'],
    ['POST', '/procurement/requisitions/{id}/convert',        'Procurement\Controllers\RequisitionController@convert',           ['auth', 'csrf'], 'procurement.pr.convert'],
    ['POST', '/procurement/requisitions/{id}/cancel',         'Procurement\Controllers\RequisitionController@cancel',            ['auth', 'csrf'], 'procurement.pr.create'],

    // ── Goods Received Notes ──
    ['GET',  '/procurement/grn',                              'Procurement\Controllers\GoodsReceivedNoteController@index',       ['auth'], 'procurement.grn.view'],
    ['GET',  '/procurement/grn/create',                       'Procurement\Controllers\GoodsReceivedNoteController@create',      ['auth'], 'procurement.grn.create'],
    ['POST', '/procurement/grn',                              'Procurement\Controllers\GoodsReceivedNoteController@store',       ['auth', 'csrf'], 'procurement.grn.create'],
    ['GET',  '/procurement/grn/{id}',                         'Procurement\Controllers\GoodsReceivedNoteController@show',        ['auth'], 'procurement.grn.view'],
    ['GET',  '/procurement/grn/{id}/inspect',                 'Procurement\Controllers\GoodsReceivedNoteController@inspectForm', ['auth'], 'procurement.grn.inspect'],
    ['POST', '/procurement/grn/{id}/inspect',                 'Procurement\Controllers\GoodsReceivedNoteController@inspect',     ['auth', 'csrf'], 'procurement.grn.inspect'],
    ['POST', '/procurement/grn/{id}/cancel',                  'Procurement\Controllers\GoodsReceivedNoteController@cancel',      ['auth', 'csrf'], 'procurement.grn.create'],

    // ── Vendor Invoices ──
    ['GET',  '/procurement/invoices',                         'Procurement\Controllers\VendorInvoiceController@index',           ['auth'], 'procurement.invoice.view'],
    ['GET',  '/procurement/invoices/create',                  'Procurement\Controllers\VendorInvoiceController@create',          ['auth'], 'procurement.invoice.create'],
    ['POST', '/procurement/invoices',                         'Procurement\Controllers\VendorInvoiceController@store',           ['auth', 'csrf'], 'procurement.invoice.create'],
    ['GET',  '/procurement/invoices/{id}',                    'Procurement\Controllers\VendorInvoiceController@show',            ['auth'], 'procurement.invoice.view'],
    ['GET',  '/procurement/invoices/{id}/edit',               'Procurement\Controllers\VendorInvoiceController@edit',            ['auth'], 'procurement.invoice.create'],
    ['POST', '/procurement/invoices/{id}/update',             'Procurement\Controllers\VendorInvoiceController@update',          ['auth', 'csrf'], 'procurement.invoice.create'],
    ['POST', '/procurement/invoices/{id}/verify',             'Procurement\Controllers\VendorInvoiceController@verify',          ['auth', 'csrf'], 'procurement.invoice.create'],
    ['POST', '/procurement/invoices/{id}/approve',            'Procurement\Controllers\VendorInvoiceController@approve',         ['auth', 'csrf'], 'procurement.invoice.approve'],
    ['POST', '/procurement/invoices/{id}/cancel',             'Procurement\Controllers\VendorInvoiceController@cancel',          ['auth', 'csrf'], 'procurement.invoice.approve'],
    ['GET',  '/procurement/invoices/{id}/match',              'Procurement\Controllers\VendorInvoiceController@matchView',       ['auth'], 'procurement.invoice.view'],

    // ── Vendor Payments ──
    ['GET',  '/procurement/payments',                         'Procurement\Controllers\VendorPaymentController@index',           ['auth'], 'procurement.payment.view'],
    ['GET',  '/procurement/payments/create',                  'Procurement\Controllers\VendorPaymentController@create',          ['auth'], 'procurement.payment.create'],
    ['POST', '/procurement/payments',                         'Procurement\Controllers\VendorPaymentController@store',           ['auth', 'csrf'], 'procurement.payment.create'],
    ['GET',  '/procurement/payments/{id}',                    'Procurement\Controllers\VendorPaymentController@show',            ['auth'], 'procurement.payment.view'],
    ['POST', '/procurement/payments/{id}/approve',            'Procurement\Controllers\VendorPaymentController@approve',         ['auth', 'csrf'], 'procurement.payment.approve'],
    ['POST', '/procurement/payments/{id}/complete',           'Procurement\Controllers\VendorPaymentController@complete',        ['auth', 'csrf'], 'procurement.payment.approve'],
    ['POST', '/procurement/payments/{id}/void',               'Procurement\Controllers\VendorPaymentController@void',            ['auth', 'csrf'], 'procurement.payment.approve'],

    // ── Return to Vendor ──
    ['GET',  '/procurement/rtv',                              'Procurement\Controllers\ReturnToVendorController@index',          ['auth'], 'procurement.rtv.view'],
    ['GET',  '/procurement/rtv/create',                       'Procurement\Controllers\ReturnToVendorController@create',         ['auth'], 'procurement.rtv.create'],
    ['POST', '/procurement/rtv',                              'Procurement\Controllers\ReturnToVendorController@store',          ['auth', 'csrf'], 'procurement.rtv.create'],
    ['GET',  '/procurement/rtv/{id}',                         'Procurement\Controllers\ReturnToVendorController@show',           ['auth'], 'procurement.rtv.view'],
    ['GET',  '/procurement/rtv/{id}/edit',                    'Procurement\Controllers\ReturnToVendorController@edit',           ['auth'], 'procurement.rtv.create'],
    ['POST', '/procurement/rtv/{id}/update',                  'Procurement\Controllers\ReturnToVendorController@update',         ['auth', 'csrf'], 'procurement.rtv.create'],
    ['POST', '/procurement/rtv/{id}/submit',                  'Procurement\Controllers\ReturnToVendorController@submit',         ['auth', 'csrf'], 'procurement.rtv.create'],
    ['POST', '/procurement/rtv/{id}/approve',                 'Procurement\Controllers\ReturnToVendorController@approve',        ['auth', 'csrf'], 'procurement.rtv.approve'],
    ['POST', '/procurement/rtv/{id}/ship',                    'Procurement\Controllers\ReturnToVendorController@ship',           ['auth', 'csrf'], 'procurement.rtv.manage'],
    ['POST', '/procurement/rtv/{id}/complete',                'Procurement\Controllers\ReturnToVendorController@complete',       ['auth', 'csrf'], 'procurement.rtv.manage'],
    ['POST', '/procurement/rtv/{id}/cancel',                  'Procurement\Controllers\ReturnToVendorController@cancel',         ['auth', 'csrf'], 'procurement.rtv.create'],

    // ── Supplier Price Quotes ──
    ['GET',  '/procurement/quotes',                              'Procurement\Controllers\QuoteController@index',             ['auth'], 'procurement.quote.view'],
    ['GET',  '/procurement/quotes/request',                      'Procurement\Controllers\QuoteController@createRequest',     ['auth'], 'procurement.quote.create'],
    ['POST', '/procurement/quotes/request',                      'Procurement\Controllers\QuoteController@storeRequest',      ['auth', 'csrf'], 'procurement.quote.create'],
    ['GET',  '/procurement/quotes/{id:\d+}/response',            'Procurement\Controllers\QuoteController@recordResponse',    ['auth'], 'procurement.quote.create'],
    ['POST', '/procurement/quotes/{id:\d+}/response',            'Procurement\Controllers\QuoteController@storeResponse',     ['auth', 'csrf'], 'procurement.quote.create'],
    ['GET',  '/procurement/quotes/compare',                      'Procurement\Controllers\QuoteController@compare',           ['auth'], 'procurement.quote.evaluate'],
    ['POST', '/procurement/quotes/evaluate',                     'Procurement\Controllers\QuoteController@evaluate',          ['auth', 'csrf'], 'procurement.quote.evaluate'],
    ['POST', '/procurement/quotes/evaluations/{id:\d+}/convert', 'Procurement\Controllers\QuoteController@convertToPo',      ['auth', 'csrf'], 'procurement.pr.convert'],

    // ── Delivery Tracking & Reports ──
    ['GET',  '/procurement/reports/overdue-deliveries',           'Procurement\Controllers\DeliveryTrackingController@overdueDeliveries', ['auth'], 'procurement.report'],
    ['GET',  '/procurement/reports/po-balance',                   'Procurement\Controllers\DeliveryTrackingController@poBalance',         ['auth'], 'procurement.report'],
    ['GET',  '/procurement/reports/price-deviation',              'Procurement\Controllers\DeliveryTrackingController@priceDeviation',    ['auth'], 'procurement.report'],

    // ── Reports ──
    ['GET',  '/procurement/reports/purchase-volume',          'Procurement\Controllers\ProcurementReportController@purchaseVolume',       ['auth'], 'procurement.report'],
    ['GET',  '/procurement/reports/supplier-performance',     'Procurement\Controllers\ProcurementReportController@supplierPerformance',  ['auth'], 'procurement.report'],
    ['GET',  '/procurement/reports/match-status',             'Procurement\Controllers\ProcurementReportController@matchStatus',          ['auth'], 'procurement.report'],
    ['GET',  '/procurement/reports/overdue-invoices',         'Procurement\Controllers\ProcurementReportController@overdueInvoices',      ['auth'], 'procurement.report'],
];
