const express = require('express');
const router = express.Router();
const { protect, admin } = require('../middleware/auth');
const {
  addEmployee,
  getEmployees,
  getEmployee,
  updateEmployee,
  deleteEmployee,
} = require('../controllers/employeeController');

router.use(protect);
router.post('/add', admin, addEmployee);
router.get('/list', getEmployees);
router.get('/:id', getEmployee);
router.put('/:id', admin, updateEmployee);
router.delete('/:id', admin, deleteEmployee);

module.exports = router;
