<?php
declare(strict_types=1);

return [
    // Warehouses
    ['GET',  '/inventory/warehouses',                         'Inventory\Controllers\WarehouseController@index',      ['auth'], 'warehouse.view'],
    ['GET',  '/inventory/warehouses/create',                  'Inventory\Controllers\WarehouseController@create',     ['auth'], 'warehouse.manage'],
    ['POST', '/inventory/warehouses',                         'Inventory\Controllers\WarehouseController@store',      ['auth', 'csrf'], 'warehouse.manage'],
    ['GET',  '/inventory/warehouses/{id:\d+}',                'Inventory\Controllers\WarehouseController@show',       ['auth'], 'warehouse.view'],
    ['GET',  '/inventory/warehouses/{id:\d+}/edit',           'Inventory\Controllers\WarehouseController@edit',       ['auth'], 'warehouse.manage'],
    ['POST', '/inventory/warehouses/{id:\d+}',                'Inventory\Controllers\WarehouseController@update',     ['auth', 'csrf'], 'warehouse.manage'],

    // Categories
    ['GET',  '/inventory/categories',                         'Inventory\Controllers\CategoryController@index',       ['auth'], 'inventory.view'],
    ['GET',  '/inventory/categories/create',                  'Inventory\Controllers\CategoryController@create',      ['auth'], 'inventory.manage'],
    ['POST', '/inventory/categories',                         'Inventory\Controllers\CategoryController@store',       ['auth', 'csrf'], 'inventory.manage'],
    ['GET',  '/inventory/categories/{id:\d+}/edit',           'Inventory\Controllers\CategoryController@edit',        ['auth'], 'inventory.manage'],
    ['POST', '/inventory/categories/{id:\d+}',                'Inventory\Controllers\CategoryController@update',      ['auth', 'csrf'], 'inventory.manage'],

    // Items
    ['GET',  '/inventory/items',                              'Inventory\Controllers\ItemController@index',           ['auth'], 'inventory.view'],
    ['GET',  '/inventory/items/create',                       'Inventory\Controllers\ItemController@create',          ['auth'], 'inventory.manage'],
    ['POST', '/inventory/items',                              'Inventory\Controllers\ItemController@store',           ['auth', 'csrf'], 'inventory.manage'],
    ['GET',  '/inventory/items/{id:\d+}',                     'Inventory\Controllers\ItemController@show',            ['auth'], 'inventory.view'],
    ['GET',  '/inventory/items/{id:\d+}/edit',                'Inventory\Controllers\ItemController@edit',            ['auth'], 'inventory.manage'],
    ['POST', '/inventory/items/{id:\d+}',                     'Inventory\Controllers\ItemController@update',          ['auth', 'csrf'], 'inventory.manage'],
    ['GET',  '/inventory/items/search-json',                  'Inventory\Controllers\ItemController@searchJson',      ['auth'], 'inventory.view'],

    // Stock Movements
    ['GET',  '/inventory/movements',                          'Inventory\Controllers\StockMovementController@index',  ['auth'], 'stock.view'],
    ['GET',  '/inventory/movements/create',                   'Inventory\Controllers\StockMovementController@create', ['auth'], 'stock.move'],
    ['POST', '/inventory/movements',                          'Inventory\Controllers\StockMovementController@store',  ['auth', 'csrf'], 'stock.move'],

    // Stock Transfers
    ['GET',  '/inventory/transfers',                          'Inventory\Controllers\StockTransferController@index',  ['auth'], 'stock.view'],
    ['GET',  '/inventory/transfers/create',                   'Inventory\Controllers\StockTransferController@create', ['auth'], 'stock.move'],
    ['POST', '/inventory/transfers',                          'Inventory\Controllers\StockTransferController@store',  ['auth', 'csrf'], 'stock.move'],
    ['GET',  '/inventory/transfers/{id:\d+}',                 'Inventory\Controllers\StockTransferController@show',   ['auth'], 'stock.view'],
    ['POST', '/inventory/transfers/{id:\d+}/approve',         'Inventory\Controllers\StockTransferController@approve',['auth', 'csrf'], 'stock.approve_transfer'],
    ['POST', '/inventory/transfers/{id:\d+}/receive',         'Inventory\Controllers\StockTransferController@receive',['auth', 'csrf'], 'stock.move'],

    // Stock Audits
    ['GET',  '/inventory/audits',                             'Inventory\Controllers\StockAuditController@index',     ['auth'], 'stock.audit'],
    ['GET',  '/inventory/audits/create',                      'Inventory\Controllers\StockAuditController@create',    ['auth'], 'stock.audit'],
    ['POST', '/inventory/audits',                             'Inventory\Controllers\StockAuditController@store',     ['auth', 'csrf'], 'stock.audit'],
    ['GET',  '/inventory/audits/{id:\d+}',                    'Inventory\Controllers\StockAuditController@show',      ['auth'], 'stock.audit'],
    ['GET',  '/inventory/audits/{id:\d+}/count',              'Inventory\Controllers\StockAuditController@count',     ['auth'], 'stock.audit'],
    ['POST', '/inventory/audits/{id:\d+}/count',              'Inventory\Controllers\StockAuditController@saveCount', ['auth', 'csrf'], 'stock.audit'],
    ['POST', '/inventory/audits/{id:\d+}/approve',            'Inventory\Controllers\StockAuditController@approve',   ['auth', 'csrf'], 'stock.approve_adjustment'],

    // Suppliers
    ['GET',  '/inventory/suppliers',                          'Inventory\Controllers\SupplierController@index',       ['auth'], 'supplier.view'],
    ['GET',  '/inventory/suppliers/create',                   'Inventory\Controllers\SupplierController@create',      ['auth'], 'supplier.manage'],
    ['POST', '/inventory/suppliers',                          'Inventory\Controllers\SupplierController@store',       ['auth', 'csrf'], 'supplier.manage'],
    ['GET',  '/inventory/suppliers/{id:\d+}',                 'Inventory\Controllers\SupplierController@show',        ['auth'], 'supplier.view'],
    ['GET',  '/inventory/suppliers/{id:\d+}/edit',            'Inventory\Controllers\SupplierController@edit',        ['auth'], 'supplier.manage'],
    ['POST', '/inventory/suppliers/{id:\d+}',                 'Inventory\Controllers\SupplierController@update',      ['auth', 'csrf'], 'supplier.manage'],

    // Purchase Orders
    ['GET',  '/inventory/purchase-orders',                    'Inventory\Controllers\PurchaseOrderController@index',  ['auth'], 'purchase.view'],
    ['GET',  '/inventory/purchase-orders/create',             'Inventory\Controllers\PurchaseOrderController@create', ['auth'], 'purchase.create'],
    ['POST', '/inventory/purchase-orders',                    'Inventory\Controllers\PurchaseOrderController@store',  ['auth', 'csrf'], 'purchase.create'],
    ['GET',  '/inventory/purchase-orders/{id:\d+}',           'Inventory\Controllers\PurchaseOrderController@show',   ['auth'], 'purchase.view'],
    ['POST', '/inventory/purchase-orders/{id:\d+}/submit',    'Inventory\Controllers\PurchaseOrderController@submit', ['auth', 'csrf'], 'purchase.create'],
    ['POST', '/inventory/purchase-orders/{id:\d+}/approve',   'Inventory\Controllers\PurchaseOrderController@approve',['auth', 'csrf'], 'purchase.approve'],
    ['GET',  '/inventory/purchase-orders/{id:\d+}/receive',   'Inventory\Controllers\PurchaseOrderController@receiveForm', ['auth'], 'purchase.create'],
    ['POST', '/inventory/purchase-orders/{id:\d+}/receive',   'Inventory\Controllers\PurchaseOrderController@receive',['auth', 'csrf'], 'purchase.create'],
    ['POST', '/inventory/purchase-orders/{id:\d+}/cancel',    'Inventory\Controllers\PurchaseOrderController@cancel', ['auth', 'csrf'], 'purchase.approve'],

    // Assets
    ['GET',  '/inventory/assets',                             'Inventory\Controllers\AssetController@index',          ['auth'], 'asset.view'],
    ['GET',  '/inventory/assets/{id:\d+}',                    'Inventory\Controllers\AssetController@show',           ['auth'], 'asset.view'],
    ['POST', '/inventory/assets/{id:\d+}/dispose',            'Inventory\Controllers\AssetController@dispose',        ['auth', 'csrf'], 'asset.manage'],
    ['POST', '/inventory/assets/run-depreciation',            'Inventory\Controllers\AssetController@runDepreciation',['auth', 'csrf'], 'asset.manage'],

    // Bill of Materials (BOM)
    ['GET',  '/inventory/bom',                                'Inventory\Controllers\BomController@index',              ['auth'], 'inventory.bom.view'],
    ['GET',  '/inventory/bom/create',                         'Inventory\Controllers\BomController@create',             ['auth'], 'inventory.bom.manage'],
    ['POST', '/inventory/bom',                                'Inventory\Controllers\BomController@store',              ['auth', 'csrf'], 'inventory.bom.manage'],
    ['GET',  '/inventory/bom/{id:\d+}',                       'Inventory\Controllers\BomController@show',               ['auth'], 'inventory.bom.view'],

    // Opening Balances
    ['GET',  '/inventory/opening-balances',                    'Inventory\Controllers\OpeningBalanceController@index',   ['auth'], 'inventory.opening.manage'],
    ['GET',  '/inventory/opening-balances/create',             'Inventory\Controllers\OpeningBalanceController@create',  ['auth'], 'inventory.opening.manage'],
    ['POST', '/inventory/opening-balances',                    'Inventory\Controllers\OpeningBalanceController@store',   ['auth', 'csrf'], 'inventory.opening.manage'],

    // Asset Custody
    ['GET',  '/inventory/assets/custody',                      'Inventory\Controllers\AssetCustodyController@index',     ['auth'], 'asset.view'],
    ['GET',  '/inventory/assets/custody/{id:\d+}/transfer',    'Inventory\Controllers\AssetCustodyController@transfer',  ['auth'], 'asset.manage'],
    ['POST', '/inventory/assets/custody/{id:\d+}/transfer',    'Inventory\Controllers\AssetCustodyController@storeTransfer', ['auth', 'csrf'], 'asset.manage'],
    ['GET',  '/inventory/assets/custody/{id:\d+}/history',     'Inventory\Controllers\AssetCustodyController@history',   ['auth'], 'asset.view'],

    // Reports
    ['GET',  '/inventory/reports/stock-balance',              'Inventory\Controllers\InventoryReportController@stockBalance',       ['auth'], 'report.inventory'],
    ['GET',  '/inventory/reports/movements',                  'Inventory\Controllers\InventoryReportController@movements',          ['auth'], 'report.inventory'],
    ['GET',  '/inventory/reports/expiry-alert',               'Inventory\Controllers\InventoryReportController@expiryAlert',        ['auth'], 'report.inventory'],
    ['GET',  '/inventory/reports/low-stock',                  'Inventory\Controllers\InventoryReportController@lowStock',           ['auth'], 'report.inventory'],
    ['GET',  '/inventory/reports/depreciation',               'Inventory\Controllers\InventoryReportController@depreciationSchedule',['auth'], 'report.inventory'],
    ['GET',  '/inventory/reports/audit-variance',             'Inventory\Controllers\InventoryReportController@auditVariance',      ['auth'], 'report.inventory'],
    ['GET',  '/inventory/reports/supplier-history',           'Inventory\Controllers\InventoryReportController@supplierHistory',    ['auth'], 'report.inventory'],
];
