const express = require("express");
const router = express.Router();
const {
  getUsers,
  createUser,
  deleteUser,
  login,
  register,
  googleAuth,
  microsoftAuth,
  requestPasswordReset,
  resetPassword,
  patchProfile,
  updateUserById,
  getHrStatus,
} = require("../controllers/users");
const authMiddleware = require("../middleware/authMiddleware");

router.get("/hr-status", authMiddleware, getHrStatus);
router.patch("/profile", authMiddleware, patchProfile);
router.patch("/:id", authMiddleware, updateUserById);

router.get("/", authMiddleware, getUsers);

router.post("/", authMiddleware, createUser);

router.delete("/", authMiddleware, deleteUser);

router.post("/login", login);

router.post("/register", register);

router.post("/google-auth", googleAuth);

router.post("/microsoft-auth", microsoftAuth);

router.post("/request-password-reset", requestPasswordReset);

router.post("/reset-password/:token", resetPassword);

module.exports = router;
