const express = require('express');
const router = express.Router();
const incidentTypeController = require('../controllers/incidentTypeController');
const requireAdmin = require('../middleware/adminMiddleware');

// Get all incident types (public - needed for forms)
router.get('/', incidentTypeController.getAll);

// Get incident type by ID (public - needed for forms)
router.get('/:id', incidentTypeController.getById);

// Create new incident type (admin only)
router.post('/', requireAdmin, incidentTypeController.create);

// Update incident type (admin only)
router.put('/:id', requireAdmin, incidentTypeController.update);

// Delete incident type (admin only)
router.delete('/:id', requireAdmin, incidentTypeController.delete);

module.exports = router;

