const express = require('express');
const router = express.Router();
const {createDepartment, getAllDepartments, getDepartmentByCode, updateDepartment, deleteDepartment} = require('../controllers/departmentController');
const { authMiddleware } = require('../middleware/authMiddleware');

router.use(authMiddleware);

router.post('/', createDepartment);
router.get('/', getAllDepartments);
router.get('/:code', getDepartmentByCode);
router.put('/:code', updateDepartment);
router.delete('/:code', deleteDepartment);

module.exports = router;