const express = require("express");
const SubSubCatagory = require("../controllers/subsubcatagory");
const router = express.Router();



router.post("/addnew", SubSubCatagory.postNew);
router.get("/GetAllSubSubCatagoryByPermitedType", SubSubCatagory.GetAllSubSubCatagoryByPermitedType);




router.put("/dododo", SubSubCatagory.updateSubsubcatagory);
router.get("/GetByAcc/:name", SubSubCatagory.GetByAcc);
router.get("/GetModelByAcc/:brand", SubSubCatagory.GetModelByAcc);

router.get("/GetModelByModel/:model", SubSubCatagory.GetModelByModel);
router.get("/GetModelByModelbybrandalso/:model/:brand", SubSubCatagory.GetModelByModelbybrandalso);

router.get("/GetAllAMP/:model/:name", SubSubCatagory.GetAllAMP);
router.get("/getAllBrandModel/:brand/:model", SubSubCatagory.getAllBrandModel);

router.get("/getAllByType/:type", SubSubCatagory.getAllByType);
router.get("/getAllByTypeByBrand/:type/:brand", SubSubCatagory.getAllByTypeByBrand);
router.get("/getAllByTypeByModel/:type/:model", SubSubCatagory.getAllByTypeByModel);
router.get("/getLandingSixRetail", SubSubCatagory.getLandingSixRetail);
router.get("/getLandingSixRetailByType", SubSubCatagory.getLandingSixRetailByType);


router.get("/GetAllById/:id", SubSubCatagory.GetAllById);





router.patch("/AddSubCatagory", SubSubCatagory.AddSubCat);
router.patch("/updateEditedData/:id", SubSubCatagory.updateEditedData);

router.patch("/updateEditedDataimage/:id", SubSubCatagory.updateEditedDataimage);
router.patch("/EditedDataimage/:id/:index", SubSubCatagory.EditedDataimage);

router.delete("/DeleteImage/:id/:index", SubSubCatagory.DeleteImagebyIndex); 

router.patch("/updateEditedDataNewDB/:id", SubSubCatagory.updateEditedDataNewDb);


router.patch("/updateshowHideStatus/:id", SubSubCatagory.updateshowHideStatus);


router.delete("/DeleteSubsubcatagory/:id", SubSubCatagory.DeleteSubsubcatagory);
router.delete("/DeleteSubsubcatagoryMany", SubSubCatagory.DeleteSubsubcatagoryMany);
















router.get("/GetAllSubSubCatagory", SubSubCatagory.GetAllCatagory);
router.get("/getAllByBrand/:brand", SubSubCatagory.getAllByBrand);
router.get("/getAllByModel/:model", SubSubCatagory.getAllByModel);
router.get("/getAllByType/:type", SubSubCatagory.getAllByType);





// Trade Site Get

router.get("/GetAllSubSubCatagoryByPermitedTypeTS", SubSubCatagory.GetAllSubSubCatagoryByPermitedTypeTS);



router.get("/GetByAccTS/:name", SubSubCatagory.GetByAccTS);
router.get("/GetModelByAccTS/:brand", SubSubCatagory.GetModelByAccTS); 
router.get("/GetModelByModelTS/:model", SubSubCatagory.GetModelByModelTS);
router.get("/GetModelByModelbybrandalsoTS/:model/:brand", SubSubCatagory.GetModelByModelbybrandalsoTS); 
router.get("/GetAllAMPTS/:model/:name", SubSubCatagory.GetAllAMPTS);
router.get("/getAllBrandModelTS/:brand/:model", SubSubCatagory.getAllBrandModelTS); 
router.get("/getAllByTypeTS/:type", SubSubCatagory.getAllByTypeTS);
router.get("/getAllByTypeByBrandTS/:type/:brand", SubSubCatagory.getAllByTypeByBrandTS);
router.get("/getAllByTypeByModelTS/:type/:model", SubSubCatagory.getAllByTypeByModelTS); 
router.get("/GetAllByIdTS/:id", SubSubCatagory.GetAllByIdTS);
router.get("/getLandingSixTrade", SubSubCatagory.getLandingSixTrade);









// Dashboard


router.get("/getAllByTypeDD/:type", SubSubCatagory.getAllByTypeDD);
router.get("/getAllByModelDD/:model", SubSubCatagory.getAllByModelDD);
router.get("/getAllByBrandDD/:brand", SubSubCatagory.getAllByBrandDD); 
router.get("/GetByFilterForRetail", SubSubCatagory.GetByFilterForRetail); 
router.get("/GetByFilterForRetailByType", SubSubCatagory.GetByFilterForRetailByType); 
router.get("/GetByFilterForRetailByModel", SubSubCatagory.GetByFilterForRetailByModel); 
router.get("/GetByFilterForRetailByTypeAndBrand", SubSubCatagory.GetByFilterForRetailByTypeAndBrand); 
router.get("/GetByFilterForTrade", SubSubCatagory.GetByFilterForTrade); 
router.get("/GetByFilterForTradeByType", SubSubCatagory.GetByFilterForTradeByType); 
router.get("/GetByFilterForTradeByModel", SubSubCatagory.GetByFilterForTradeByModel); 
router.get("/GetByFilterForTradeByTypeAndBrand", SubSubCatagory.GetByFilterForTradeByTypeAndBrand); 


router.get("/GetAllSubSubCatagoryDD", SubSubCatagory.GetAllCatagoryDD);
router.get("/GetAllSubSubCatagoryDD/:page/:limit", SubSubCatagory.GetAllCatagoryDD2);
router.patch("/UpdateSSC/:id", SubSubCatagory.UpdateSSC);

router.put("/updateProductSequence", SubSubCatagory.updateProductSequence);











// ------------------------------------New Routes For Latest Add Accessory Page------------------------


router.get('/getAllSubSubCatagoryByMD/:page/:limit',SubSubCatagory.getAllSubSubCatagoryByMD);
router.get('/getSSCatsWithBrand/:catagory',SubSubCatagory.getSSCatsWithBrand);
router.get('/getSSCatsWithModel/:subcatagory',SubSubCatagory.getSSCatsWithModel);
router.get('/getSSCatsWithType/:type',SubSubCatagory.getSSCatsWithType);
router.get('/getProductCountByVariant/:variant',SubSubCatagory.getProductCountByVariant);
router.patch('/getVariantRemovedFromAll/:variant',SubSubCatagory.getVariantRemovedFromAll);
router.get('/getProductCountByManufacturer/:manufacturer',SubSubCatagory.getProductCountByManufacturer);
router.patch('/getManufacturerRemovedFromAll/:manufacturer',SubSubCatagory.getManufacturerRemovedFromAll);
router.get('/getProductCountByColor/:color',SubSubCatagory.getProductCountByColor);
router.patch('/getColorRemovedFromAll/:color',SubSubCatagory.getColorRemovedFromAll);
router.post('/createnew',SubSubCatagory.CreateNewAccessory);
router.put('/getExistingUpdated/:id',SubSubCatagory.getExistingUpdated);
router.post('/deleteRequiredAccessories/:SKU',SubSubCatagory.deleteRequiredAccessories);
router.get('/getASingleAccessory/:id',SubSubCatagory.getASingleAccessory);

router.post('/UpdateManyDataFields',SubSubCatagory.UpdateManyDataFields);





module.exports = router;     

