const express = require("express");
const router = express.Router();

const auth = require("../middleware/Auth");
const userController = require("../controller/user");
const orderController = require("../controller/order");
const businesCatController = require("../controller/superAdmin"); 
const supportController = require("../controller/support");
const productController = require("../controller/product");
const favouriteController = require("../controller/favourite");
const refundController = require("../controller/refund");

// User Auth Routes;
router.post("/user/signup", userController.signup);
router.post("/user/verifyOTP", userController.verifyOTP);
router.post("/user/login", userController.login);
router.get("/user/userProfile", userController.getUserProfile);
router.post("/user/updateUser", auth.uploadUser.single("userImage"), userController.updateUser);
router.post("/user/addLocation", userController.addLocation);
router.post("/user/selectLocation", userController.selectLocation);
router.get("/user/getAllUserLocations", userController.getAllUserLocations);
router.post("/user/editLocation", userController.editLocation);
router.post("/user/deleteLocation", userController.deleteLocation);
router.post("/user/deleteUser", userController.deleteUser);

router.post("/user/forgetPassword", userController.ForgetPassword);
router.post("/user/verifyOTPForPassword", userController.verifyOTPForPassword);
router.post("/user/resetPassword", userController.resetPassword);

// Favourite Routes
router.post("/user/addFavrouite", favouriteController.addToFavourite);
router.get("/user/allFavourites", favouriteController.getAllFavourites);

// Business Categories
router.get("/user/getAllbusinessCategories", businesCatController.getAllCategories);

// Support Routes
router.post("/user/support", supportController.addSupport);

// Search Routes
router.get("/user/searchProducts", productController.searchProducts);

// Notificatoin Routes
router.get("/user/getNotifications", orderController.getNotifications);

// Refund Routes
router.post("/user/createRefundRequest", refundController.createRefundReq);
router.get("/user/getAllRefundRequests", refundController.getAllRefundReqs);
router.get("/user/getRefundRequestById", refundController.getRefundReq);

module.exports = router;