import express from "express";
import {
  getProductsAndStockByPD,
  getProductsAndStockByRD,
} from "./StockController.js";
import { authorizeRoles, isAuthenticatedUser } from "../../middlewares/auth.js";
import {isAuthenticatedRD} from "../../middlewares/rdAuth.js";
const router = express.Router();

router.get(
  "/pd/stock/:userId",
  isAuthenticatedUser,
  authorizeRoles("admin"),
  getProductsAndStockByPD
);
router.get(
  "/rd/stock/:userId",
  isAuthenticatedUser,
  authorizeRoles("admin"),
  getProductsAndStockByRD
);
router.get("/stock", isAuthenticatedRD, getProductsAndStockByRD);
export default router;
