const express = require('express');
const router = express.Router();
const NotificationController = require('../controllers/notification');
const { authenticate } = require('../middleware/auth');

router.get('/', authenticate, NotificationController.getUserNotifications);
router.get(
  '/unread-count',
  authenticate,
  NotificationController.getUnreadCount
);
router.get(
  '/preferences',
  authenticate,
  NotificationController.getNotificationPreferences
);
router.put(
  '/preferences',
  authenticate,
  NotificationController.updateNotificationPreferences
);
router.put('/fcm-token', authenticate, NotificationController.updateFCMToken);
router.put(
  '/:notificationId/read',
  authenticate,
  NotificationController.markAsRead
);
router.put(
  '/mark-all-read',
  authenticate,
  NotificationController.markAllAsRead
);
router.delete(
  '/:notificationId',
  authenticate,
  NotificationController.deleteNotification
);

module.exports = router;
