<?php
declare(strict_types=1);

/** @var \App\Core\Router $router */

use App\Middleware\AuthMiddleware;
use App\Middleware\TenantMiddleware;

$mw = [AuthMiddleware::class, TenantMiddleware::class];

// Products
$router->get('/products', 'ProductController@index', $mw);
$router->post('/products', 'ProductController@store', $mw);
$router->post('/products/upload-image', 'ProductController@uploadImage', $mw);
$router->get('/products/search', 'ProductController@search', $mw);
$router->get('/products/low-stock', 'ProductController@lowStock', $mw);
$router->get('/products/export', 'ProductController@export', $mw);
$router->post('/products/import', 'ProductController@import', $mw);
$router->get('/products/{id}', 'ProductController@show', $mw);
$router->put('/products/{id}', 'ProductController@update', $mw);
$router->delete('/products/{id}', 'ProductController@destroy', $mw);
$router->get('/products/{id}/movements', 'ProductController@movements', $mw);

// Inventory
$router->get('/inventory', 'InventoryController@index', $mw);
$router->get('/inventory/valuation', 'InventoryController@valuation', $mw);
$router->post('/inventory/adjust', 'InventoryController@adjust', $mw);
$router->post('/inventory/transfer', 'InventoryController@transfer', $mw);
$router->get('/inventory/warehouses', 'InventoryController@getWarehouses', $mw);
$router->post('/inventory/warehouses', 'InventoryController@storeWarehouse', $mw);
$router->put('/inventory/warehouses/{id}', 'InventoryController@updateWarehouse', $mw);
$router->delete('/inventory/warehouses/{id}', 'InventoryController@deleteWarehouse', $mw);
$router->get('/inventory/users/{id}/warehouses', 'InventoryController@getUserWarehouses', $mw);
$router->post('/inventory/users/{id}/warehouses', 'InventoryController@assignUserWarehouses', $mw);

// HSN Search
$router->get('/hsn/search', 'HSNController@search', $mw);
