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

const auth = require("../middleware/Auth");
const superAdminController = require("../controller/superAdmin");
const supportController = require("../controller/support");
const refundController = require("../controller/refund");
const adminController = require("../controller/admin");
const orderController = require("../controller/order");
const userController = require("../controller/user");

// Admin Auth Routes
router.post("/superAdmin/signup", superAdminController.signup);
router.post("/superAdmin/login", superAdminController.login);
router.get("/superAdmin/getSuperAdmin", superAdminController.getSuperAdmin);
router.post("/superAdmin/updateSuperAdmin", superAdminController.updateSuperAdmin);
router.post("/superAdmin/forgetPassword", superAdminController.forgetPassword);
router.post("/superAdmin/verifyOTPForPassword", superAdminController.verifyOTPForPassword);
router.post("/superAdmin/resetPassword", superAdminController.resetPassword);

// Business Category Routes
router.post("/superAdmin/addBusinessCat", superAdminController.addBusinessCategory);
router.get("/superAdmin/getAllbusinessCategories", superAdminController.getAllCategories);
router.post("/superAdmin/deleteBusinessCat", superAdminController.deleteCategory);

// Support Routes
router.get("/superAdmin/getAllSupport", supportController.getAllSupport);
router.get("/superAdmin/getSupportById", supportController.getSupportById);
router.post("/superAdmin/deleteSupport", supportController.deleteSupport);

// Refund Routes
router.get("/superAdmin/getAllrefundRequests", refundController.getAllRefundReqs);
router.get("/superAdmin/getRefundRequestById", refundController.getRefundReq);
router.post("/superAdmin/updateRefundRequest", refundController.updateRefundReq);

// Feature Routes
router.post("/superAdmin/createFeature", auth.uploadAdmin.single("Banner"), superAdminController.createFeature);
router.get("/superAdmin/getAllFeatures", superAdminController.getAllFeatures);
router.get("/superAdmin/getFeatureById", superAdminController.getFeatureById);
router.post("/superAdmin/updateFeature", auth.uploadAdmin.single("Banner"), superAdminController.updateFeature);
router.post("/superAdmin/deleteFeature", superAdminController.deleteFeature);

// User Routes
router.get("/superAdmin/getAllUsers", userController.getAllUsers);
router.get("/superAdmin/getUserById", userController.getUserProfile);

// Shop Routes 
router.get("/superAdmin/getAllShops", adminController.getAllShops);
router.get("/superAdmin/getShopById", adminController.getShopById);

// Order Routes
router.get("/superAdmin/getAllOrders", orderController.getAllOrders);
router.get("/superAdmin/getOrderById", orderController.getOrderById);

// Stats Route
router.get("/superAdmin/AllOverStats", superAdminController.statsForSuperAdmin);

module.exports = router;
