const express = require("express");
const router = express.Router();
const warehouseController = require("../../controllers/securityops/warehouseController");
const authorize = require("../../middlewares/authorize");
const authenticate = require("../../middlewares/authenticate")

router.post("/create",authenticate, authorize(["admin", "security", "qc"]), (req,res) =>{
    warehouseController.createWarehouse(req, res)
});

router.get("/all",authenticate,   (req, res) =>{
     warehouseController.getWarehouses(req, res);
});

// router.get("/:id", (req, res) =>{
//     warehouseController.getWarehouseById(req, res)
// });

router.put("/update/:id",authenticate, authorize(["admin","security","qc"]),  (req, res) =>{
    warehouseController.updateWarehouse(req, res)
});

router.delete("/delete/:id",authenticate, authorize(["admin","security","qc"]),  (req, res) =>{
    warehouseController.deleteWarehouse(req, res)
});

module.exports = router;