import express from "express";
import {
	getAllDepartments,
	getDepartmentByName,
	createDepartment,
	updateDepartment,
	deleteDepartment,
} from "../controllers/department.controller.js";
import jwtAuthMiddleware from "../middleware/auth.js";

const router = express.Router();

// Public
router.get("/getAll", getAllDepartments);
router.get("/search", getDepartmentByName);

// Protected
router.post("/", jwtAuthMiddleware, createDepartment);
router.put("/:departmentId", jwtAuthMiddleware, updateDepartment);
router.delete("/:departmentId", jwtAuthMiddleware, deleteDepartment);

export default router;
