import { Router } from "express"; import { authorize } from "../middlewares/jwt.middleware"; import { createAccessController, getAllBranchesController, getAllMetadataController, createBranchController, createDepartmentController, createDesignationController, createRoleController, updateRoleController, getAllEmployeeController, getEmployeeDetailsController, getEmployeeLocationHistoryController, } from "../controllers/admin.controller"; import { createEmployee } from "../controllers/workflow.controller"; const router = new Router(); router.post("/access", authorize("access", "write"), createAccessController); router.get("/branches", authorize("branch", "read"), getAllBranchesController); router.get( "/metadata", authorize("designation", "read"), getAllMetadataController, ); router.post("/branch", authorize("branch", "write"), createBranchController); router.post( "/department", authorize("department", "write"), createDepartmentController, ); router.get("/employees", authorize("user", "read"), getAllEmployeeController); router.post("/employee", authorize("user", "write"), createEmployee); router.get( "/employee/:id", authorize("user", "read"), getEmployeeDetailsController, ); router.get( "/employee/:user/locations", authorize("user", "read"), getEmployeeLocationHistoryController, ); router.post( "/designation", authorize("designation", "write"), createDesignationController, ); router.post("/role", authorize("role", "write"), createRoleController); router.patch("/role/:id", authorize("role", "write"), updateRoleController); export default router;