

const express = require("express");
const router = express.Router();
const gatePassController = require("../../controllers/dispatch/gatePassController");
const upload = require("../../middlewares/upload");
const authenticate = require("../../middlewares/authenticate");
const authorize = require("../../middlewares/authorize");


router.get("/gate-passes",authenticate,
  (req,res) =>{
      gatePassController.getAllGatePasses(req,res);
  }
  
);

router.get(
  "/gate-pass/:id",
 authenticate,
  (req,res) =>{
      gatePassController.getGatePassById(req,res);
  }
  
);

router.delete(
  "/:id",
  authenticate,
  (req,res) =>{
      gatePassController.deleteGatePass(req,res);
  }
  
);


router.get("/:id/download",
  authenticate,
   (req,res) =>{
      gatePassController.downloadGatePassPDF(req,res);
  }
);


module.exports = router;