const express = require("express");
var app = express();
var bodyParser = require('body-parser');
app.use(bodyParser.json({ limit: '100mb' }));
app.use(bodyParser.urlencoded({ limit: '500mb', extended: true, parameterLimit: 100000 }));
const { catchErrors,checkToken} = require("../handlers/errorHandlers");
const router = express.Router();
const AuthController = require("../controllers/ShopperrB2C/AuthController");
const SolrController = require("../controllers/ShopperrB2C/SolrController");
const ProductController = require("../controllers/ShopperrB2C/ProductController");
//_______________________________ Start Amz SP-API List Orders management_______________________________
router.route("/auth/login").post(catchErrors(AuthController.Login));
router.route("/solr/searchproducts").post(catchErrors(SolrController.searchProducts));
router.route("/solr/searchproductList").post(catchErrors(SolrController.searchProductList));
router.route("/auth/settingsUpdateCustomers").post(checkToken,catchErrors(AuthController.customersSettingUpdate));
router.route("/getproductinfoByPId").post(ProductController.getProductInfobyProductId);
router.route("/addtocart").post(ProductController.addToCart);
router.route("/checkout").post(ProductController.productCheckout);
module.exports = router;
