const { sendMaterialCostUpdateMail, sendServiceCostUpdateMail } = require("../controllers/mail");
const {
    addProduct,
    getProductById,
    updateProduct,
    deleteProduct,
    getAllProducts,
    getAllMeterialProducts,
    addMaterialProduct,
    getTaxCategory,
    getLastVendorMaterialUnitCost,
    addFinishedProduct,
    getFinishedProducts,
    getAllFinishedProducts,
    CreateReceiveOrder,
    getAllReceiveOrders,
    getOrderById,
    updateReceiveOrder,
    deleteFinishedProduct,
    getFinishedProductById,
    editFinishedProduct,
    moveFinishedProductToPartial,
    EditReceiveOrder,
    cancelReceiveOrder,
    addDataSet,
    getDataSet,
    addProductCategory,
    editProductCategory,
    getAllProductCategories,
    deleteProductCategory,
    addProductSubcategory,
    getAllProductSubCategories,
    getSubCategoryById,
    editProductSubCategory,
    deleteProductSubCategory,
    getSubcategoryFromCategoryId,
    updateInventory,
    fetchInventoryAuditLog,
    getFinishedProductDataByID,
    getAllRecipe,
    addLabourCostServices,
    updateLabourCostServices,
    getAllLabourCostServices,
    getLabourCostServicesById,
    deleteLabourCostServices,
    addLabourCostServiceType,
    updateLabourCostServiceTypes,
    deleteLabourCostServiceTypes,
    getAllLabourCostServiceTypes,
    getLabourCostServiceTypesById,
    duplicateProduct,
    uploadMaterial,
    uploadCatalog,
    checkAllMeterialStock,
    addDataToProductTableOnReq,
    addTaxCategory,
    getTaxCategoryById,
    updateTaxCategory,
    deleteTaxCategory,
    getAllTaxCategory,
    fetchQBCategories,
    getPartialFinishedProducts,
    moveFinishedProductToWaste,
    getPartialFinishedProductsStockByUnit,
    deletePartialFinishedProduct,
    refillFinishedProduct,
    getFinishedAndPartialProducts,
    moveMaterialToClientOwned,
    fetchQbAccount,
    getAllMeterialProductsInvAudit,
    updateMainLabelSettings,
    getMainLabelSettings,
    updateSmallLabelSettings,
    getSmallLabelSettings,
    getClientStockLogsController,
    updateInhouse,
    moveLabourCostService,
    markProductViewed,
    searchFinishedProductByQR,fetchAllAvalaraItems,
    syncAllCatalogProductsToQuickBooks,
    syncAllMaterialProductsToQuickBooks,
    getAllReceiveOrdersLatestFirst,
    getRecipeById,
    getAllLabourCostServicesForJobCost,
    getAllLabourCostServicesOnly,
    markLabourServiceViewed,
    getAllSalesOrdersForAutocomplete,
    getAllMeterialProductsFiltered
}
    = require("../controllers/product");


const productRoutes = [
    {
        method: "POST",
        url: "/webservice/product/add-product",
        handler: addProduct
    },
    {
        method: "POST",
        url: "/webservice/product/get-catalog-stocks",
        handler: getClientStockLogsController
    },
    {
        method: "POST",
        url: "/webservice/product/get-product-by-id",
        handler: getProductById
    },
    {
        method: "POST",
        url: "/webservice/product/get-recipe-by-id",
        handler: getRecipeById
    },
    {
        method: "POST",
        url: "/webservice/product/duplicate",
        handler: duplicateProduct

    },
    {
        method: "POST",
        url: "/webservice/product/update-product",
        handler: updateProduct
    },
    {
        method: "POST",
        url: "/webservice/product/delete-product",
        handler: deleteProduct
    },
    {
        method: "POST",
        url: "/webservice/product/get-all-products",
        handler: getAllProducts
    },
    {
        method: "POST",
        url: "/webservice/product/get-all-materials",
        handler: getAllMeterialProducts
    },
    {
        method: "POST",
        url: "/webservice/product/get-all-materials-filtered",
        handler: getAllMeterialProductsFiltered
    },
    {
        method: "POST",
        url: "/webservice/product/get-all-materials-autit",
        handler: getAllMeterialProductsInvAudit
    },
    {
        method: "POST",
        url: "/webservice/product/search-finished-product-by-qr",
        handler: searchFinishedProductByQR
    },
    {
        method: "POST",
        url: "/webservice/product/check-all-material-stock",
        handler: checkAllMeterialStock
    },
    {
        method: "POST",
        url: "/webservice/product/get-last-vendor-material-unit-cost",
        handler: getLastVendorMaterialUnitCost
    },
    {
        method: "POST",
        url: "/webservice/product/add-material",
        handler: addMaterialProduct
    },
    {
        method: "POST",
        url: "/webservice/product/upload-material",
        handler: uploadMaterial
    },
    {
        method: "POST",
        url: "/webservice/product/upload-catalog",
        handler: uploadCatalog
    },
    {
        method: "POST",
        url: "/webservice/product/get-tax-category",
        handler: getTaxCategory
    },
    {
        method: "POST",
        url: "/webservice/product/get-all-tax-category",
        handler: getAllTaxCategory
    },
    {
        method: "POST",
        url: "/webservice/product/get-tax-category-by-id",
        handler: getTaxCategoryById
    },
    {
        method: "POST",
        url: "/webservice/product/add-tax-category",
        handler: addTaxCategory
    },
    {
        method: "POST",
        url: "/webservice/product/update-tax-category",
        handler: updateTaxCategory
    },
    {
        method: "POST",
        url: "/webservice/product/delete-tax-category",
        handler: deleteTaxCategory
    },
    {
        method: "POST",
        url: "/webservice/product/add-finished-product",
        handler: addFinishedProduct
    },
    {
        method: "POST",
        url: "/webservice/product/get-finished-products",
        handler: getFinishedProducts
    },
    {
        method: "POST",
        url: "/webservice/product/get-finished-and-partial-products",
        handler: getFinishedAndPartialProducts
    },
    {
        method: "POST",
        url: "/webservice/product/get-partial-finished-products",
        handler: getPartialFinishedProducts
    },
    {
        method: "POST",
        url: "/webservice/product/get-partial-finished-products-stock-by-unit",
        handler: getPartialFinishedProductsStockByUnit
    },
    {
        method: "POST",
        url: "/webservice/product/get-finished-product-byId",
        handler: getFinishedProductDataByID
    },
    {
        method: "POST",
        url: "/webservice/product/get-all-finished-products",
        handler: getAllFinishedProducts
    },
    {
        method: "POST",
        url: "/webservice/product/delete-finished-product",
        handler: deleteFinishedProduct
    },
    {
        method: "POST",
        url: "/webservice/product/get-finished-product-by-id",
        handler: getFinishedProductById
    },
    {
        method: "POST",
        url: "/webservice/product/edit-finished-product",
        handler: editFinishedProduct
    },
    {
        method: "POST",
        url: "/webservice/product/move-finished-product-partial",
        handler: moveFinishedProductToPartial
    },
    {
        method: "POST",
        url: "/webservice/product/move-finished-product-to-waste",
        handler: moveFinishedProductToWaste
    },
    {
        method: "POST",
        url: "/webservice/product/refill-finished-product",
        handler: refillFinishedProduct
    },
    {
        method: "POST",
        url: "/webservice/product/delete-partial-finished-product",
        handler: deletePartialFinishedProduct
    },
    {
        method: "POST",
        url: "/webservice/product/update-inventory",
        handler: updateInventory
    },
    {
        method: "POST",
        url: "/webservice/product/fetch-inventory-audit-log",
        handler: fetchInventoryAuditLog
    },
    {
        method: "POST",
        url: "/webservice/product/create-receive-order",
        handler: CreateReceiveOrder
    },
    {
        method: "POST",
        url: "/webservice/product/edit-receive-order",
        handler: EditReceiveOrder
    },
    {
        method: "POST",
        url: "/webservice/product/get-all-receive-orders",
        handler: getAllReceiveOrders
    },
    {
        method: "POST",
        url: "/webservice/product/get-all-receive-orders-latest-first",
        handler: getAllReceiveOrdersLatestFirst
    },
    {
        method: "POST",
        url: "/webservice/product/get-order-by-id",
        handler: getOrderById
    },
    {
        method: "POST",
        url: "/webservice/product/get-sales-orders-for-autocomplete",
        handler: getAllSalesOrdersForAutocomplete
    },
    {
        method: "POST",
        url: "/webservice/products/update-receive-order",
        handler: updateReceiveOrder
    },
    {
        method: "POST",
        url: "/webservice/products/cancel-receive-order",
        handler: cancelReceiveOrder
    },
    {
        method: "POST",
        url: "/webservice/products/dataset",
        handler: addDataSet
    },
    {
        method: "POST",
        url: "/webservice/products/get-data-set",
        handler: getDataSet
    },
    {
        method: "POST",
        url: "/webservice/product/add-product-category",
        handler: addProductCategory
    },
    {
        method: "POST",
        url: "/webservice/product/update-product-category",
        handler: editProductCategory
    },
    {
        method: "POST",
        url: "/webservice/product/get-all-product-categories",
        handler: getAllProductCategories
    },
    {
        method: "POST",
        url: "/webservice/product/delete-product-category",
        handler: deleteProductCategory
    },
    {
        method: "POST",
        url: "/webservice/product/add-product-sub-category",
        handler: addProductSubcategory
    },
    {
        method: "POST",
        url: "/webservice/product/update-product-sub-category",
        handler: editProductSubCategory
    },
    {
        method: "POST",
        url: "/webservice/product/get-all-sub-category",
        handler: getAllProductSubCategories
    },
    {
        method: "POST",
        url: "/webservice/product/get-sub-category-by-id",
        handler: getSubCategoryById
    },
    {
        method: "POST",
        url: "/webservice/product/delete-product-sub-category",
        handler: deleteProductSubCategory
    },
    {
        method: "POST",
        url: "/webservice/product/get-subcategory",
        handler: getSubcategoryFromCategoryId
    },
    {
        method: "POST",
        url: "/webservice/product/add-labour-cost-services",
        handler: addLabourCostServices
    },
    {
        method: "POST",
        url: "/webservice/product/update-labour-cost-services",
        handler: updateLabourCostServices
    },
    {
        method: "POST",
        url: "/webservice/product/move-labour-cost-service",
        handler: moveLabourCostService
    },
    {
        method: "POST",
        url: "/webservice/product/delete-labour-cost-services",
        handler: deleteLabourCostServices
    },
    {
        method: "POST",
        url: "/webservice/product/get-all-labour-cost-services",
        handler: getAllLabourCostServices
    },
    {
        method: "POST",
        url: "/webservice/product/get-all-labour-cost-services-only",
        handler: getAllLabourCostServicesOnly
    },
    {
        method: "POST",
        url: "/webservice/product/get-all-labour-cost-services-for-job-cost",
        handler: getAllLabourCostServicesForJobCost
    },
    {
        method: "POST",
        url: "/webservice/product/get-labour-cost-services-by-id",
        handler: getLabourCostServicesById
    },
    {
        method: "POST",
        url: "/webservice/product/add-labour-cost-service-type",
        handler: addLabourCostServiceType
    },
    {
        method: "POST",
        url: "/webservice/product/update-labour-cost-service-type",
        handler: updateLabourCostServiceTypes
    },
    {
        method: "POST",
        url: "/webservice/product/delete-labour-cost-service-type",
        handler: deleteLabourCostServiceTypes
    },
    {
        method: "POST",
        url: "/webservice/product/get-all-labour-cost-service-types",
        handler: getAllLabourCostServiceTypes
    },
    {
        method: "POST",
        url: "/webservice/product/get-labour-cost-service-types-by-id",
        handler: getLabourCostServiceTypesById
    },
    {
        method : "POST",
        url : "/webservice/product/send-material-cost-update-mail",
        handler : sendMaterialCostUpdateMail
    },
    {
        method : "POST",
        url : "/webservice/product/send-service-cost-update-mail",
        handler : sendServiceCostUpdateMail
    },
    {
        method : "POST",
        url : "/webservice/product/add-product-on-request",
        handler : addDataToProductTableOnReq
    },
    {
        method : "POST",
        url : "/webservice/product/get-qb-categories",
        handler : fetchQBCategories
    },
    {
        method: "POST",
        url: "/webservice/product/move-to-client-owned",
        handler: moveMaterialToClientOwned
    },
    {
        method : "POST",
        url : "/webservice/product/get-qb-accounts",
        handler : fetchQbAccount
    },
    {
        method: "POST",
        url: "/webservice/print/update-settings",
        handler: updateMainLabelSettings
    },
    {
        method: "POST",
        url: "/webservice/print/get-main-label-settings",
        handler: getMainLabelSettings
    },
    {
        method: "POST",
        url: "/webservice/print/update-small-label-settings",
        handler: updateSmallLabelSettings
    },
    {
        method: "POST",
        url: "/webservice/print/get-small-label-settings",
        handler: getSmallLabelSettings
    },
    {
        method: "POST",
        url: "/webservice/product/update-inhouse",
        handler: updateInhouse
    },
    {
        method: "POST",
        url: "/webservice/product/mark-viewed",
        handler: markProductViewed
    },
    {
        method: "POST",
        url: "/webservice/product/mark-labour-service-viewed",
        handler: markLabourServiceViewed
    },
    {
        method: "POST",
        url: "/webservice/avalara/get-all-tax-category",
        handler: fetchAllAvalaraItems
    },
    {
        method : "POST",
        url : "/webservice/products/sync-all-catalog-products-to-quickbooks",
        handler : syncAllCatalogProductsToQuickBooks
    },
    {
        method : "POST",
        url : "/webservice/products/sync-all-material-products-to-quickbooks",
        handler : syncAllMaterialProductsToQuickBooks
    },
];
module.exports = productRoutes;