import express from "express";
import { createCrudRouter } from "./crudRouter.js";

/**
 * Master / lookup tables. All single-PK; full CRUD via the generic router.
 * Mounted under `/ptw` so paths are e.g. `/api/ptw/job_title`.
 */
const router = express.Router();

router.use("/job_title", createCrudRouter("job_title", ["job_title_id"]));
router.use("/roles", createCrudRouter("roles", ["role_id"]));
router.use("/account_status", createCrudRouter("account_status", ["status_id"]));
router.use("/departments", createCrudRouter("departments", ["department_id"]));
router.use("/country", createCrudRouter("country", ["country_id"]));
router.use("/city", createCrudRouter("city", ["city_id"]));
router.use("/tickets_status", createCrudRouter("tickets_status", ["status_id"]));
router.use("/tickets_type", createCrudRouter("tickets_type", ["type_id"]));
router.use("/ptw_form_type", createCrudRouter("ptw_form_type", ["form_type_id"]));
router.use("/ptw_job_type", createCrudRouter("ptw_job_type", ["job_type_id"]));
router.use(
  "/ptw_question_type",
  createCrudRouter("ptw_question_type", ["question_type_id"])
);
router.use(
  "/ptw_permit_status",
  createCrudRouter("ptw_permit_status", ["permit_status_id"])
);

export default router;
