// const express = require("express");
// const router = express.Router();
// const userController = require("../controllers/userController");
// const upload = require("../middlewares/upload");

// /**
//  * @swagger
//  * tags:
//  *   name: Public Auth
//  *   description: Public Authentication & Registration APIs
//  */

// // Register User (Public)
// router.post("/register", upload.single("profileImage"), (req, res) => {
//     /*
//       #swagger.tags = ['Public Auth']
//       #swagger.summary = 'Register a new user (Public)'
//     */
//     userController.registerUser(req, res);
// });

// // Login User (Public)
// router.post("/login", (req, res) => {
//     /*
//       #swagger.tags = ['Public Auth']
//       #swagger.summary = 'Login user (Public)'
//       #swagger.parameters['body'] = {
//         in: 'body',
//         required: true,
//         schema: { email: "dev@servicenxt.in", password: "123456" }
//       }
//     */
//     userController.loginUser(req, res);
// });

// // Forgot Password (Public)
// router.post("/forgot-password", (req, res) => {
//     /*
//       #swagger.tags = ['Public Auth']
//       #swagger.summary = 'Request password reset (Public)'
//     */
//     userController.forgotPassword(req, res);
// });


// router.get("/get/doctors", (req, res) => {
//     /*
//       #swagger.tags = ['Public Doctors']
//       #swagger.summary = 'Get doctors '
//     */
//     userController.getDoctors(req, res)
// })


// router.get("/:id/profile", (req, res) => {
//     /*
//       #swagger.tags = ['Public Doctors']             
//       #swagger.summary = 'Get doctor profile'
//       #swagger.description = 'Fetch doctor profile details'
//     */
//     userController.getDoctorProfile(req, res);
//   }
// );

// // Send OTP (Public)
// // router.post("/send-otp", (req, res) => {
// //   /*
// //     #swagger.tags = ['Public Agents']
// //     #swagger.summary = 'Send OTP to agent phone (Public)'
// //   */
// //   userController.sendAgentOtp(req, res);
// // });

// // // Verify OTP (Public)
// // router.post("/verify-otp", (req, res) => {
// //   /*
// //     #swagger.tags = ['Public Agents']
// //     #swagger.summary = 'Verify OTP and login agent (Public)'
// //   */
// //   userController.verifyAgentOtp(req, res);
// // });

// // // Resend OTP (Public)
// // router.post("/resend-otp", (req, res) => {
// //   /*
// //     #swagger.tags = ['Public Agents']
// //     #swagger.summary = 'Resend OTP (Public)'
// //   */
// //   userController.resendAgentOtp(req, res);
// // });

// module.exports = router;



const express = require("express");
const router = express.Router();
const userController = require("../controllers/userController");
const upload = require("../middlewares/upload");

/**
 * @swagger
 * tags:
 *   name: Public Auth
 *   description: Public Authentication & Registration APIs
 */

router.post("/register", upload.single("profileImage"), (req, res) => {
    /*
      #swagger.tags = ['Public Auth']
      #swagger.summary = 'Register a new user (Public)'
      #swagger.parameters['body'] = {
        in: 'body',
        required: true,
        schema: {
          firstName: "John",
          email: "john@gmail.com",
          password: "123456",
          phone: "9876543210",
          orgId: "65f1c2e4a1b2c3d4e5f67890"
        }
      }
    */
    userController.registerUser(req, res);
});

router.post("/login", (req, res) => {
    /*
      #swagger.tags = ['Public Auth']
      #swagger.summary = 'Login user (Public)'
      #swagger.parameters['body'] = {
        in: 'body',
        required: true,
        schema: { 
          email: "dev@servicenxt.in", 
          password: "123456",
          orgId: "65f1c2e4a1b2c3d4e5f67890"
        }
      }
    */
    userController.loginUser(req, res);
});

router.post("/forgot-password", (req, res) => {
    /*
      #swagger.tags = ['Public Auth']
      #swagger.summary = 'Request password reset (Public)'
      #swagger.parameters['body'] = {
        in: 'body',
        required: true,
        schema: { 
          email: "john@gmail.com",
          orgId: "65f1c2e4a1b2c3d4e5f67890"
        }
      }
    */
    userController.forgotPassword(req, res);
});

router.get("/get/doctors", (req, res) => {
    /*
      #swagger.tags = ['Public Doctors']
      #swagger.summary = 'Get doctors by organization'
      #swagger.parameters['orgId'] = {
        in: 'query',
        required: true,
        type: 'string',
        description: 'Organization ID'
      }
    */
    userController.getDoctors(req, res);
});

router.get("/:id/profile", (req, res) => {
    /*
      #swagger.tags = ['Public Doctors']             
      #swagger.summary = 'Get doctor profile (Public)'
      #swagger.parameters['orgId'] = {
        in: 'query',
        required: true,
        type: 'string'
      }
    */
    userController.getDoctorProfile(req, res);
});

module.exports = router;
