// routes/inventoryRoutes.js
const express = require('express');
const router = express.Router();
const inventoryController = require('../controllers/inventoryController');
const { authenticate, authorize } = require('../middleware/auth');

router.use(authenticate);

router.get('/', inventoryController.getInventory);
router.get('/low-stock', inventoryController.getLowStockItems);
router.post('/adjust', authenticate,authorize('admin', 'manager', 'inventory_manager'), inventoryController.adjustInventory);
router.get('/movements', inventoryController.getStockMovements);
router.post('/transfer', authorize('admin', 'manager'), inventoryController.transferStock);

router.post('/adjustment',authorize('admin', 'manager', 'inventory_manager'), inventoryController.createStockAdjustment);

router.get('/stock-adjustments',authorize('admin', 'manager', 'inventory_manager'), inventoryController.getStockAdjustments);

module.exports = router;