const router = require('express').Router();
const { authMiddleware } = require('../middleware/auth');
const ctrl = require('../controllers/notificationController');

// SSE stream — auth done inside handler via ?token param (EventSource can't set headers)
router.get('/stream',      ctrl.stream);

router.use(authMiddleware);
router.get('/',            ctrl.list);
router.post('/read-all',   ctrl.markAllRead);
router.patch('/:id/read',  ctrl.markRead);

module.exports = router;
