import { Router } from 'express';
import notificationController from '../controllers/notification.controller';
import { authenticate } from '../middleware/auth.middleware';

const router = Router();

// All routes require authentication; users only see their own notifications.
router.get('/',                  authenticate, notificationController.getNotifications.bind(notificationController));
router.get('/count',             authenticate, notificationController.getUnreadCount.bind(notificationController));
router.patch('/:id/read',        authenticate, notificationController.markAsRead.bind(notificationController));
router.post('/mark-all-read',    authenticate, notificationController.markAllRead.bind(notificationController));
router.post('/dismiss-by-type', authenticate, notificationController.dismissByType.bind(notificationController));
router.delete('/read',           authenticate, notificationController.deleteAllRead.bind(notificationController));

export default router;
