import express from "express";

import {
  createnew,
  getAllcarrency,
  updatecarrency,
  deletecarrency,
} from "./CurrencyController.js";
import { isAuthenticatedUser, authorizeRoles } from "../../middlewares/auth.js";

const router = express.Router();

router
  .route("/new")
  .post(isAuthenticatedUser, authorizeRoles("admin", "Employee"), createnew);
router.route("/getall").get(getAllcarrency);
// router.route("/getoneblog/:id").get(getOneBlog);
router
  .route("/:id")
  .delete(
    isAuthenticatedUser,
    authorizeRoles("admin", "Employee"),
    deletecarrency
  );

router
  .route("/:id")
  .patch(
    isAuthenticatedUser,
    authorizeRoles("admin", "Employee"),
    updatecarrency
  );
export default router;
