const express = require('express');
const router = express.Router();
const notificationController = require('../controllers/notificationController');
const verifyAccessTokenMiddleware = require('../middleware/verifyAccessToken');
const verifyRole = require('../middleware/verifyRole');

/**
 * All notification routes require authentication
 */

// Get all notifications
router.get('/', verifyAccessTokenMiddleware, notificationController.getAll);

// Get notification by id
router.get('/:id', verifyAccessTokenMiddleware, notificationController.getById);

// Create new notification
router.post('/', verifyAccessTokenMiddleware, notificationController.create);

// Update notification
router.put('/:id', verifyAccessTokenMiddleware, notificationController.update);

// Restore notification
router.put('/:id/restore', verifyAccessTokenMiddleware, notificationController.restore);

// Delete notification (soft delete)
router.delete('/:id', verifyAccessTokenMiddleware, verifyRole(['superadmin']), notificationController.delete);

module.exports = router;
