const { sendMessage, viewMessage, sendJobNoteMessage, viewJobNoteMessage } = require('../controllers/clientChat')
const { rfqOnboardProcess } = require('../controllers/onboard')
const { getAllProposals, addRfp,getProposalById, updateProposalData, deleteProposalById ,saveProposalOrder} = require('../controllers/proposals')
const {
  getAllRequests, addRequests, addRequestDraft, getRequestById,getRequestByIdProductionInnerPage, getRequestAttachments, getRequestUpdates, getSplitEstimateUpdates, getRequestServices, getOrderDetailsData, editRequest, editRequestDraft,
  deleteRequestById, addRequetPartners, requestSearch, acceptOrRejectRequest, acceptOrRejectInvoice, reopenRequest, getAllClientRequestId, uploadDesigns, addRequestPayments, updateDesigns, fetchAllPayments, deletePayment, editRequestPayments, getRequestByCommunityId, getProjectByCommunityId,
  getProjectByClientId,
  getJobByClientId,
  getCommunityByClient,
  getCommunitiesForClientAutocomplete,
  getAllQuotations,
  getAllQuotationsAdd,
  getAllQuotationsCards,
  acceptOrRejectQuotation,
  updateEstimateHoldStatus,
  reopenQuotation,
  convertQuotation,
  acceptOrRejectRequestNew,
  saveQuickbidOffReqOrder,
  acceptFinalInvoice,
  addDesignOrder,
  updateDesignOrderCardOrder,
  getAllDesignOrders,
  getDesignOrderById,
  duplicateDesignOrder,
  mergeDuplicatedDesignOrderToSalesOrder,
  mergeDuplicatedDesignOrderToRequestEstimate,
  updateDesignOrder,
  deleteDesignOrderById,
  acceptOrRejectDesignOrder,
  convertDesignToSalesOrder,
  convertDesignToRequestEstimate,
  updatePaymentFromQb,
  updateDesignOrderJobStatus,
  getAllQuotationsCount,
  getAllDesignOrdersCount,
  getAllRequestsNew,
  getAllRequestsTotalCount,
  getRequestByIdNew,
  updateDesignOrderDueDate,
  getCompletedInstallsByCommunityId,
  getCompleteDesignByCommunityId,
  updateProductsAddress,
  updateServiceAddress,
  sendApprovalReqDesignOrder,
  updateMultiDesigns,
  unlinkMultiDesigns,
  getAllDesignOrdersTabCount,
  reduceDesignOrderCount,
  reduceEstimateTabCount,
  getAllEstimateTabCount,
  getAllSalesOrderTabCount,
  reduceSalesOrderTabCount,
  reduceDesignOrderJobsCount,
  getWorkflowMembers,
  getJobNoteMembers,
  getJobCostNotesDetails,
  sendToClientEstimate,
  duplicateRequest,
  deleteDesignOrderAttachment,
  deleteDesignOrderDesign,
  updateSalesOrderHoldStatus,
  acceptReviewOrder,
  updateReviewInvoiceTotal,
  deleteRequestServiceById,
  addRequestService,
  acceptOrRejectInvoiceSplit,
  convertDesignToSplitEstimate,
  getRequestByIdWithoutTeamAndProducts,
  getProductsForRequest,
  deleteRequestByIdEstimate,
  getAllRequestsForAdd,
  getAllRequestFilters,
  getAllQuotationFilters,
  changeNewOrderStatusSalesOrderTab,
  sendInvoicePdfToEmail,
  saveEditedPdfImage,
  getAttachmentImages,
  createEstimateJob,
  getRequestLabourCostServices,
  approveSplitOrderInvoiceRequest,
  updateReceivedStatus,
  getRequestByIdProducts,
  getRequestByIdMaterials,
  rejectSalesOrderFromJob,
  reopenRequestJob,
  updateProductRowEstimate,
  convertEstimateToDesignOrder,
  deleteDraftEstimate,
  getRequestDataForInstalationById,
  updateDesignOrderRequestedDueDate,
  updateServiceRowEstimate,
  addEmail,
  getEmails,
  saveEditedPdfFile,
  revertRequestStatus,
  revertRequestToProduction,
  getAllOverViewCount,
  getDesignProductionOverViewCount,
  getEstimateJobNewData,
  getRequestByIdForInvoice,
} = require('../controllers/request')
const { addProposal, updateProposal, deleteProposal, updateProposalStatus, convertRFPToRFQ, updateProposalStatusPayment } = require('../controllers/requestProposals')
const { addSplitEstimate, fetchAllSplitEstimates, fetchAllSplitEstimateDetails, updateSplitEstimateStatus } = require('../controllers/SplitEstimate')
const {
  addDesignFormTemplate,
  getAllDesignFormTemplate,
  getDesignFormTemplateById,
  updateDesignFormTemplate,
  deleteDesignFormTemplate,
  deactivateDesignFormTemplate,
  duplicateDesignFormTemplate,
  linkModuleToTemplate,
  getDesignFormTemplatesByModule,
  getAllTemplatesWithDataByModule,
  saveDesignFormTemplate,
  batchSaveDesignFormTemplates,
  getDesignFormTemplateWithSavedValues,
  getAllDesignFormTemplatesWithSavedValues
} = require('../controllers/designFormTemplate')



const requestRoutes = [
  {
    method: "POST",
    url: "/webservice/request/get-all-request",
    handler: getAllRequests,
  },
  {
    method: "POST",
    url: "/webservice/request/get-all-request-for-add",
    handler: getAllRequestsForAdd,
  },
  {
    method: "POST",
    url: "/webservice/request/get-all-request-filters",
    handler: getAllRequestFilters,
  },
  {
    method: "POST",
    url: "/webservice/request/get-all-quotation-filters",
    handler: getAllQuotationFilters,
  },
  {
    method: "POST",
    url: "/webservice/request/get-all-request-new",
    handler: getAllRequestsNew,
  },
  {
    method: "POST",
    url: "/webservice/request/get-all-request-total-count",
    handler: getAllRequestsTotalCount,
  },
  {
    method: "POST",
    url: "/webservice/request/get-all-quotations",
    handler: getAllQuotations,
  },
  {
    method: "POST",
    url: "/webservice/request/get-all-quotations-add",
    handler: getAllQuotationsAdd,
  },
  {
    method: "POST",
    url: "/webservice/request/get-all-quotations-cards",
    handler: getAllQuotationsCards,
  },
  {
    method: "POST",
    url: "/webservice/request/get-all-quotations-count",
    handler: getAllQuotationsCount,
  },
  {
    method: "POST",
    url: "/webservice/request/get-all-proposals",
    handler: getAllProposals,
  },
  {
    method: "POST",
    url: "/webservice/request/add-request",
    handler: async (request, reply) => {
      request.io = request.server.io;
      console.log('🔌 Socket.IO instance:', !!request.io);
      console.log('🔌 Socket.IO type:', typeof request.io);
      console.log('🔌 Server.io available:', !!request.server.io);
      return addRequests(request, reply);
    },
  },
  {
    method: "POST",
    url: "/webservice/request/add-request-draft",
    handler: async (request, reply) => {
      request.io = request.server.io;
      return addRequestDraft(request, reply);
    },
  },
  {
    method: "GET",
    url: "/webservice/request/test-socket",
    handler: async (request, reply) => {
      request.io = request.server.io;
      console.log('🧪 Testing Socket.IO connection...');
      
      if (request.io) {
        const testData = {
          step: 'test',
          message: 'Socket.IO test message from server',
          progress: 50,
          timestamp: Date.now(),
          userId: 'test-user'
        };
        
        console.log('🧪 Emitting test message:', testData);
        request.io.emit('request_progress', testData);
        
        return reply.send({ 
          status: 1, 
          message: 'Test message sent via Socket.IO',
          socketAvailable: true 
        });
      } else {
        return reply.send({ 
          status: 0, 
          message: 'Socket.IO not available',
          socketAvailable: false 
        });
      }
    },
  },
  {
    method: "POST",
    url: "/webservice/request/add-rfp",
    handler: addRfp,
  },
  {
    method: 'POST',
    url: "/webservice/view-request",
    handler: getRequestById,
  },
  {
    method: 'POST',
    url: "/webservice/view-request-for-invoice",
    handler: getRequestByIdForInvoice,
  },
  {
    method: 'POST',
    url: "/webservice/view-request-installation",
    handler: getRequestDataForInstalationById,
  },
  {
    method: 'POST',
    url: "/webservice/view-request-products",
    handler: getRequestByIdProducts,
  },
  {
    method: 'POST',
    url: "/webservice/view-request-materials",
    handler: getRequestByIdMaterials,
  },
  {
    method: 'POST',
    url: "/webservice/view-request-production-inner-page",
    handler: getRequestByIdProductionInnerPage,
  },
  {
    method: 'POST',
    url: "/webservice/request/get-attachments",
    handler: getRequestAttachments,
  },
  {
    method: 'POST',
    url: "/webservice/request/get-updates",
    handler: getRequestUpdates,
  },
  {
    method: 'POST',
    url: "/webservice/request/get-split-estimate-updates",
    handler: getSplitEstimateUpdates,
  },
  {
    method: 'POST',
    url: "/webservice/request/get-services",
    handler: getRequestServices,
  },
  {
    method: 'POST',
    url: "/webservice/request/get-order-details-data",
    handler: getOrderDetailsData,
  },
  {
    method: 'POST',
    url: "/webservice/view-request-new",
    handler: getRequestByIdNew,
  },
  {
    method: 'POST',
    url: "/webservice/view-proposal",
    handler: getProposalById,
  },
  {
    method: 'POST',
    url: "/webservice/rfq/convert-to-rfq",
    handler:convertRFPToRFQ,
  },
  {
    method: 'POST',
    url: "/webservice/edit-request",
    handler: editRequest,
  },
  {
    method: 'POST',
    url: "/webservice/edit-request-draft",
    handler: editRequestDraft,
  },
  {
    method: 'POST',
    url: "/webservice/duplicate-request",
    handler: duplicateRequest,
  },
  {
    method: 'POST',
    url: "/webservice/quotation/send-to-client",
    handler: sendToClientEstimate,
  },
  {
    method: 'POST',
    url: "/webservice/update-proposal",
    handler: updateProposalData,
  },
  {
    method: 'POST',
    url: "/webservice/delete-request/id",
    handler: deleteRequestById,
  },
  {
    method: 'POST',
    url: "/webservice/delete-request-estimate/id",
    handler: deleteRequestByIdEstimate,
  },
  {
    method: 'POST',
    url: "/webservice/delete-proposal/id",
    handler: deleteProposalById,
  },
  {
    method: 'POST',
    url: "/webservice/request/add-clients",
    handler: addRequetPartners,
  },
  {
    method: 'POST',
    url: "/webservice/request/get-labour-cost-services",
    handler: getRequestLabourCostServices,
  },
  {
    method: 'POST',
    url: '/webservice/request-search',
    handler: requestSearch,
  },
  {
    method: 'POST',
    url: '/webservice/request/accept-or-reject-request',
    handler: acceptOrRejectRequest,
  },
  {
    method: 'POST',
    url: '/webservice/request/accept-or-reject-request-new',
    handler: acceptOrRejectRequestNew,
  },
  {
    method: 'POST',
    url: '/webservice/request/reject-sales-order-from-job',
    handler: rejectSalesOrderFromJob,
  },
  {
    method: 'POST',
    url: '/webservice/request/accept-final-invoice',
    handler: acceptFinalInvoice,
  },
  {
    method: 'POST',
    url: '/webservice/request/accept-or-reject-invoice',
    handler: acceptOrRejectInvoice,
  },
  {
    method: 'POST',
    url: '/webservice/request/create-or-update-estimate-job',
    handler: createEstimateJob,
  },
  {
    method: 'POST',
    url: '/webservice/request/accept-or-reject-quotation',
    handler: acceptOrRejectQuotation,
  },
  {
    method: 'POST',
    url: '/webservice/quotation/update-estimate-hold-status',
    handler: updateEstimateHoldStatus,
  },
  {
    method: 'POST',
    url: '/webservice/request/fetch-all-clients-request',
    handler: getAllClientRequestId,
  },
  {
    method: 'POST',
    url: '/webservice/request/reopen',
    handler: reopenRequest,
  },
  {
    method: 'POST',
    url: '/webservice/request/reopen-job',
    handler: reopenRequestJob,
  },
  {
    method: 'POST',
    url: '/webservice/quotation/reopen',
    handler: reopenQuotation,
  },
  {
    method: 'POST',
    url: '/webservice/quotation/convert-rfq',
    handler: convertQuotation,
  },
  {
    method: 'POST',
    url: '/webservice/request/sent-public-message',
    handler: sendMessage,
  },
   {
    method: 'POST',
    url: '/webservice/request/sent-job-note-message',
    handler: sendJobNoteMessage,
  },
  {
    method: 'POST',
    url: '/webservice/request/view-public-message',
    handler: viewMessage,
  },
  {
    method: 'POST',
    url: '/webservice/request/view-job-note-message',
    handler: viewJobNoteMessage,
  },
  {
    method: 'POST',
    url: '/webservice/request/upload-designs',
    handler: uploadDesigns,
  },
  {
    method: 'POST',
    url: '/webservice/request/update-designs',
    handler: updateDesigns,
  },
  {
    method: 'POST',
    url: '/webservice/request/get-attachment-images',
    handler: getAttachmentImages,
  },
  {
    method: 'POST',
    url: '/webservice/request/save-edited-pdf-image',
    handler: saveEditedPdfImage,
  },
  {
    method: 'POST',
    url: '/webservice/request/save-edited-pdf-file',
    handler: saveEditedPdfFile,
  },
  {
    method: 'POST',
    url: '/webservice/request/update-design-order-due-date',
    handler: updateDesignOrderDueDate,
  },
  {
    method: 'POST',
    url: '/webservice/request/update-design-order-requested-due-date',
    handler: updateDesignOrderRequestedDueDate,
  },
  {
    method: 'POST',
    url: '/webservice/request/add-payment',
    handler: addRequestPayments,
  },
  {
    method: 'POST',
    url: '/webservice/request/edit-payment',
    handler: editRequestPayments,
  },
  {
    method: 'POST',
    url: '/webservice/request/fetch-all-payments',
    handler: fetchAllPayments,
  },
  {
    method: 'POST',
    url: '/webservice/request/delete-payment',
    handler: deletePayment,
  },
  {
    method: 'POST',
    url: "/webservice/rfq/process",
    handler: rfqOnboardProcess,
  },
  {
    method: 'POST',
    url: "/webservice/rfq/add-proposal",
    handler: addProposal,
  },
  {
    method: 'POST',
    url: "/webservice/rfq/update-proposal",
    handler: updateProposal,
  },
  {
    method: 'POST',
    url: "/webservice/rfq/delete-proposal",
    handler: deleteProposal,
  },
  {
    method: 'POST',
    url: "/webservice/rfq/update-proposal-status",
    handler: updateProposalStatus,
  },
  {
    method: 'POST',
    url: "/webservice/rfq/update-proposal-status-payment",
    handler: updateProposalStatusPayment,
  },
  {
    method: 'POST',
    url: "/webservice/rfq/get-request-by-community",
    handler: getRequestByCommunityId,
  },
  {
    method: 'POST',
    url: "/webservice/rfq/get-project-by-community",
    handler: getProjectByCommunityId,
  },
  {
    method: 'POST',
    url: "/webservice/rfq/get-design-by-community",
    handler: getCompleteDesignByCommunityId,
  },
  {
    method: 'POST',
    url: "/webservice/rfq/get-installs-by-community",
    handler: getCompletedInstallsByCommunityId,
  },
  {
    method : "POST",
    url : "/webservice/rfq/update-products-route",
    handler : updateProductsAddress
  },
  {
    method : "POST",
    url : "/webservice/rfq/update-service-route",
    handler : updateServiceAddress
  },
  {
    method: 'POST',
    url: "/webservice/rfq/get-job-by-client",
    handler: getJobByClientId,
  },
  {
    method: 'POST',
    url: "/webservice/rfq/get-project-by-client",
    handler: getProjectByClientId,
  },
  {
    method: 'POST',
    url: "/webservice/rfq/get-community-by-client",
    handler: getCommunityByClient,
  },
  {
    method: 'POST',
    url: "/webservice/rfq/get-communities-for-client-autocomplete",
    handler: getCommunitiesForClientAutocomplete,
  },
  {
    method : "POST",
    url : "/webservice/request/save-order",
    handler :saveQuickbidOffReqOrder,
  },
  {
    method : "POST",
    url : "/webservice/proposal/save-order",
    handler :saveProposalOrder,
  },
  {
    method : "POST",
    url : "/webservice/design/add-order",
    handler :addDesignOrder,
  },
  {
    method : "POST",
    url : "/webservice/workflow/project-members",
    handler :getWorkflowMembers,
  },
  {
    method : "POST",
    url : "/webservice/request/get-job-note-members",
    handler :getJobNoteMembers,
  },
  {
    method : "POST",
    url : "/webservice/request/get-job-cost-notes-details",
    handler :getJobCostNotesDetails,
  },
  {
    method : "POST",
    url : "/webservice/design/update-card-order",
    handler :updateDesignOrderCardOrder,
  },
  {
    method: 'POST',
    url: "/webservice/delete-design-order/id",
    handler: deleteDesignOrderById,
  },
  {
    method : "POST",
    url : "/webservice/design/all-design-order",
    handler :getAllDesignOrders,
  },
  {
    method : "POST",
    url : "/webservice/design/all-design-order-count",
    handler :getAllDesignOrdersCount,
  },
  {
    method : "POST",
    url : "/webservice/design/design-order-tabs-count",
    handler :getAllDesignOrdersTabCount,
  },
  {
    method : "POST",
    url : "/webservice/design/get-design-order-by-id",
    handler :getDesignOrderById,
  },
  {
    method : "POST",
    url : "/webservice/design/duplicate-design-order",
    handler :duplicateDesignOrder,
  },
  {
    method : "POST",
    url : "/webservice/design/merge-duplicated-design-to-sales-order",
    handler :mergeDuplicatedDesignOrderToSalesOrder,
  },
  {
    method : "POST",
    url : "/webservice/design/merge-duplicated-design-to-request-estimate",
    handler :mergeDuplicatedDesignOrderToRequestEstimate,
  },
  {
    method : "POST",
    url : "/webservice/design/update-design-order",
    handler :updateDesignOrder,
  },
  {
    method: 'POST',
    url: '/webservice/design/accept-or-reject-order',
    handler: acceptOrRejectDesignOrder,
  },
  {
    method : "POST",
    url : "/webservice/design/delete-design",
    handler :deleteDesignOrderDesign,
  },
  {
    method: 'POST',
    url: '/webservice/design/reduce-count',
    handler: reduceDesignOrderCount,
  },
  {
    method: 'POST',
    url: '/webservice/design-jobs/reduce-count',
    handler: reduceDesignOrderJobsCount,
  },
  {
    method: 'POST',
    url: '/webservice/design/convert-design-to-sales-order',
    handler: convertDesignToSalesOrder,
  },
  {
    method: 'POST',
    url: '/webservice/design/convert-design-to-request-estimate',
    handler: convertDesignToRequestEstimate,
  },
  {
    method: 'POST',
    url: '/webservice/design/convert-design-to-split-estimate',
    handler: convertDesignToSplitEstimate,
  },
  {
    method: 'POST',
    url: '/webservice/sales-order/update-payment-from-qb',
    handler: updatePaymentFromQb,
  },
  {
    method: 'POST',
    url: '/webservice/design-order/update-design-order-job-status',
    handler: updateDesignOrderJobStatus,
  },
  {
    method: 'POST',
    url: '/webservice/design-order/sent-approve-req',
    handler: sendApprovalReqDesignOrder,
  },
  {
    method: 'POST',
    url: '/webservice/request/update-multi-designs',
    handler: updateMultiDesigns,
  },
  {
    method: 'POST',
    url: '/webservice/request/unlink-multi-designs',
    handler: unlinkMultiDesigns,
  },
  {
    method: 'POST',
    url: '/webservice/estimate/estimate-tabs-count',
    handler: getAllEstimateTabCount,
  },
  {
    method: 'POST',
    url: '/webservice/estimate/reduce-tabs-count',
    handler: reduceEstimateTabCount,
  },
  {
    method: 'POST',
    url: '/webservice/sales-order/sales-order-tabs-count',
    handler: getAllSalesOrderTabCount,
  },
  {
    method : "POST",
    url : "/webservice/sales_order/update-sales-order-hold-status",
    handler :updateSalesOrderHoldStatus,
  },
  {
    method: 'POST',
    url: '/webservice/sales-order/reduce-tabs-count',
    handler: reduceSalesOrderTabCount,
  },
  {
    method: 'POST',
    url: '/webservice/sales-order/change-new-order-sales-order-tab',
    handler: changeNewOrderStatusSalesOrderTab,
  },
  {
    method: 'POST',
    url: '/webservice/sales-order/accept-review-order',
    handler: acceptReviewOrder,
  },
  {
    method: 'POST',
    url: '/webservice/sales-order/update-review-invoice-total',
    handler: updateReviewInvoiceTotal,
  },
  {
    method: 'POST',
    url: '/webservice/request/add-request-service',
    handler: addRequestService,
  },
  {
    method: 'POST',
    url: '/webservice/request/delete-request-service',
    handler: deleteRequestServiceById,
  },
  {
    method: 'POST',
    url: '/webservice/request/add-split-estimate',
    handler: addSplitEstimate,
  },
  {
    method: 'POST',
    url: '/webservice/request/fetch-all-split-estimates',
    handler: fetchAllSplitEstimates,
  },
  {
    method: 'POST',
    url: '/webservice/request/fetch-all-split-estimate-details-by-id',
    handler: fetchAllSplitEstimateDetails,
  },
  {
    method: 'POST',
    url: '/webservice/request/update-split-estimate-status',
    handler: updateSplitEstimateStatus,
  },
  {
    method: 'POST',
    url: '/webservice/request/convert-sales-order-to-job-split',
    handler: acceptOrRejectInvoiceSplit,
  },

  {
    method: 'POST',
    url: '/webservice/request/view-request-estimate-new',
    handler: getRequestByIdWithoutTeamAndProducts,
  },
  {
    method: 'POST',
    url: '/webservice/request/view-estimate-job',
    handler: getEstimateJobNewData,
  },
  {
    method: 'POST',
    url: '/webservice/request/get-products',
    handler: getProductsForRequest,
  },
  {
    method: 'POST',
    url: '/webservice/request/send-invoice-pdf-to-email',
    handler: sendInvoicePdfToEmail,
  },
  // Design Form Template Routes
  {
    method: "POST",
    url: "/webservice/design-form/add-template",
    handler: addDesignFormTemplate
  },
  {
    method: "POST",
    url: "/webservice/design-form/get-all-template",
    handler: getAllDesignFormTemplate
  },
  {
    method: "POST",
    url: "/webservice/design-form/get-template-by-id",
    handler: getDesignFormTemplateById
  },
  {
    method: "POST",
    url: "/webservice/design-form/update-template",
    handler: updateDesignFormTemplate
  },
  {
    method: "POST",
    url: "/webservice/design-form/delete-template",
    handler: deleteDesignFormTemplate
  },
  {
    method: "POST",
    url: "/webservice/design-form/deactivate-template",
    handler: deactivateDesignFormTemplate
  },
  {
    method: "POST",
    url: "/webservice/design-form/duplicate-template",
    handler: duplicateDesignFormTemplate
  },
  {
    method: "POST",
    url: "/webservice/design-form/link-module",
    handler: linkModuleToTemplate
  },
  {
    method: "POST",
    url: "/webservice/design-form/get-templates-by-module",
    handler: getDesignFormTemplatesByModule
  },
  {
    method: "POST",
    url: "/webservice/design-form/get-all-templates-with-data",
    handler: getAllTemplatesWithDataByModule
  },
  {
    method: "POST",
    url: "/webservice/design-form/save-template",
    handler: saveDesignFormTemplate
  },
  {
    method: "POST",
    url: "/webservice/design-form/get-template-with-values",
    handler: getDesignFormTemplateWithSavedValues
  },
  {
    method: "POST",
    url: "/webservice/design-form/get-all-templates-with-values",
    handler: getAllDesignFormTemplatesWithSavedValues
  },
  {
    method: "POST",
    url: "/webservice/design-form/batch-save-templates",
    handler: batchSaveDesignFormTemplates
  },
  {
    method: "POST",
    url: "/webservice/request/approve-split-order-invoice",
    handler: approveSplitOrderInvoiceRequest,
  },
  {
    method: "POST",
    url: "/webservice/request/update-received-status",
    handler: updateReceivedStatus,
  },
  {
    method: "POST",
    url: "/webservice/request/update-product-row-estimate",
    handler: updateProductRowEstimate,
  },
  {
    method: "POST",
    url: "/webservice/request/update-service-row-estimate",
    handler: updateServiceRowEstimate,
  },
  {
    method: 'POST',
    url: '/webservice/quotation/convert-design-order',
    handler: convertEstimateToDesignOrder,
  },
  {
    method: "POST",
    url: "/webservice/request/delete-draft-estimate",
    handler: deleteDraftEstimate,
  },
  {
    method: 'POST',
    url: '/webservice/email/add-email',
    handler: addEmail,
  },
  {
    method: 'POST',
    url: '/webservice/email/get-emails',
    handler: getEmails,
  },
  {
    method: 'POST',
    url: '/webservice/request/revert-status',
    handler: revertRequestStatus,
  },
  {
    method: 'POST',
    url: '/webservice/request/revert-to-production',
    handler: revertRequestToProduction,
  },
  {
    method: 'POST',
    url: '/webservice/get-all-overview-counts',
    handler: getAllOverViewCount,
  },
  {
    method: 'POST',
    url: '/webservice/get-design-production-overview-counts',
    handler: getDesignProductionOverViewCount,
  },
]

module.exports = requestRoutes