const notificationRouter = require("express").Router();
const { authMiddleware } = require("../middlewares/auth.middleware");
const { canSendNotification } = require("../middlewares/rbac");
const controller = require("../controllers/notification.controller");

notificationRouter.get("/", authMiddleware, controller.getMyNotifications);
notificationRouter.get("/:id", authMiddleware, controller.getNotificationsById);

notificationRouter.post(
  "/send",
  authMiddleware,
  canSendNotification,
  controller.sendNotification
);

notificationRouter.post(
  "/send-bulk",
  authMiddleware,
  canSendNotification,
  controller.sendBulkNotification
);

notificationRouter.patch("/:id/read", authMiddleware, controller.markAsRead);

module.exports = notificationRouter;
