const express = require('express');
const router = express.Router();
const notificationController = require('../controllers/notificationController');
const authenticateToken = require('../middleware/authMiddleware');

// Get all notifications for authenticated user (requires Bearer token)
router.get('/my-notifications', authenticateToken, notificationController.getMyNotifications);

// Mark a notification as read (authenticated user)
router.patch(
    '/my-notifications/:id/read',
    authenticateToken,
    notificationController.markMyNotificationRead
);

// Mark all notifications as read (authenticated user)
router.patch(
    '/my-notifications/mark-all-read',
    authenticateToken,
    notificationController.markAllMyNotificationsRead
);

// Delete all notifications for authenticated user (requires Bearer token)
router.delete('/my-notifications', authenticateToken, notificationController.deleteAllMyNotifications);

// Get all notifications for a user
router.get('/:id', notificationController.getByUserId);

module.exports = router;



