const express = require("express");
const login = require("./controllers/adminLogin");
const {
  adminRegister,
  getAdmin,
  deleteAdmin,
} = require("./controllers/adminRegister");
const adminAuth = require("../../middleswares/adminAuth");
const pagination = require("../../middleswares/pagination");
const dashboard = require("./controllers/dashboard");
const {
  registerStaff,
  updateStaffRecord,
} = require("./controllers/registerStaff");
const { getBioData } = require("../users/recordDepartment/patientBioData");
const { getRxHx } = require("../users/clinical/controllers/rxHx");
const {
  registerHmoAndGroup,
  updateHmo,
} = require("./controllers/registerHMOAndGroup");
const {
  filterHMOs,
  hmoCounter,
  getFamiliesAndGroup,
} = require("./controllers/getHMOAndGroup");
const {
  registerHosp,
  registerHospitalOnline,
} = require("./controllers/registerHospital");
const getStaff = require("./controllers/getStaffs");
//const auth = require("../../middleswares/auth");

const systemAdminRoute = express.Router();

systemAdminRoute.post("/login", login);
systemAdminRoute.post("/online/register", registerHospitalOnline);
systemAdminRoute.use(adminAuth);
systemAdminRoute.post("/register", adminRegister);
systemAdminRoute.get("/dashboard", dashboard);
systemAdminRoute.get("/fetchadminofficers", pagination, getAdmin);
systemAdminRoute.get("/getrxhx", pagination, getRxHx);
systemAdminRoute.get("/getpatientbiodata", pagination, getBioData);
systemAdminRoute.post("/newstaffreg", registerStaff);
systemAdminRoute.delete("/removeadmin", deleteAdmin);
systemAdminRoute.get("/getstaffsdetails", pagination, getStaff);
systemAdminRoute.get(
  "/fetchfamiliesandgroupdata",
  pagination,
  getFamiliesAndGroup
);
systemAdminRoute.post("/hmoregistration", registerHmoAndGroup);
systemAdminRoute.post("/reghospitalsetting", registerHosp);
systemAdminRoute.put("/updatehmorecord", updateHmo);
systemAdminRoute.put("/updatestaffrecord", updateStaffRecord);
systemAdminRoute.get("/fetchhmos", filterHMOs);
systemAdminRoute.get("/hmocounter", hmoCounter);
module.exports = systemAdminRoute;
