{"size": 1766, "ext": "js", "max_stars_repo_path": "src/routes/projectAndEmployee.js", "max_stars_repo_name": "krishna91822/vb-erp-backend", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "src/routes/projectAndEmployee.js", "max_issues_repo_name": "krishna91822/vb-erp-backend", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "src/routes/projectAndEmployee.js", "max_forks_repo_name": "krishna91822/vb-erp-backend", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 20.5348837209, "max_line_length": 56, "alphanum_fraction": 0.7491506229}
//importing express
const express = require("express");
const ProjectEmployeeRouter = express.Router();
const { hasPermission } = require("../middleware/auth");

//importing from controller
const {
  createAllocations,
  updateAllocation,
  deleteAllocation,
  getAllocations,
  getSortedAllocations,
  getAllocationsOnBench,
  getSortedAllocationsOnBench,
  getTotalAllocationByEmpId,
  getFilteredEmployee,
  getManagers,
} = require("../controllers/projectEmployeeController");

// POST request
ProjectEmployeeRouter.post(
  "/",
  hasPermission("create_project_in_PMO"),
  createAllocations
);

// PUT request
ProjectEmployeeRouter.put(
  "/",
  hasPermission("update_project_in_PMO"),
  updateAllocation
);

// DELETE request
ProjectEmployeeRouter.delete(
  "/:id",
  hasPermission("create_project_in_PMO"),
  deleteAllocation
);

// GET request
ProjectEmployeeRouter.get(
  "/allocated",
  hasPermission("view_PMO_module"),
  getAllocations
);
ProjectEmployeeRouter.get(
  "/allocated/:fieldName",
  hasPermission("view_PMO_module"),
  getSortedAllocations
);

// GET request
ProjectEmployeeRouter.get(
  "/onbench",
  hasPermission("view_PMO_module"),
  getAllocationsOnBench
);
ProjectEmployeeRouter.get(
  "/onbench/:fieldName",
  hasPermission("view_PMO_module"),
  getSortedAllocationsOnBench
);

// GET request
ProjectEmployeeRouter.get(
  "/totalallocation",
  hasPermission("view_PMO_module"),
  getTotalAllocationByEmpId
);

/* ********************************** */
// Getting employee module's integrated data
ProjectEmployeeRouter.get(
  "/filteremp",
  hasPermission("view_PMO_module"),
  getFilteredEmployee
);
ProjectEmployeeRouter.get(
  "/managers",
  hasPermission("view_PMO_module"),
  getManagers
);

module.exports = ProjectEmployeeRouter;
