const express = require('express');
const router = express.Router();
const { asyncHandler, authUser, authAdmin } = require('../auth/checkAuth');
const notificationController = require('../controller/notification.controller');

// Public route to get active notification
router.get('/notification/active', asyncHandler(notificationController.getActiveNotification));

// Admin routes
router.get('/notifications', authAdmin, asyncHandler(notificationController.getNotifications));
router.post('/notification', authAdmin, asyncHandler(notificationController.createNotification));
router.put('/notification/:id', authAdmin, asyncHandler(notificationController.updateNotification));
router.delete('/notification/:id', authAdmin, asyncHandler(notificationController.deleteNotification));

module.exports = router;
