const { outgoingCall, incomingCall, generateWorkerToken, enqueueCall, recordingStatusCallback, onHold, getIncomingCallLogs, updateAvailableForCall, playHoldMusic, smsLogs, getTwilioCallSettings, updateTwilioCallSettings, getAllRecordingsList, getAnalyticsData, imTasks, callFlows, createCallFlow, editCallFlow, activateCallFlow, deleteCallFlow, advanceCallFlowSettings, getCallFlowDataById, callForwarding, getUserById, conferenceStatusCallback, acceptReservation, assignmentCallback, initiateMessage, addOutgoingCallDetailsAjax, getIncomingCallNumber, addIncomingCallDetails, scanCrmPhoneNumber, incomingMessage, callForwardingWhenNotAnswered } = require("../controllers/callCenter");

const callCenterRoutes = [
  {
    method: "GET",
    url: "/call-center/makeTwilioCall",
    handler: outgoingCall,
  },
  {
    method: "POST",
    url: "/initiate-call",
    handler: incomingCall,
  },
  {
    method: "POST",
    url: "/fetch-worker-token",
    handler: generateWorkerToken,
  },
  {
    method: "POST",
    url: "/enqueue-call",
    handler: enqueueCall,
  },
  {
    method: "POST",
    url: "/twilio-calls/recording-status-callback",
    handler: recordingStatusCallback,
  },
  {
    method: "POST",
    url: "/twilio-calls/on-hold",
    handler: onHold,
  },
  {
    method: "POST",
    url: "/twilio-calls/forward-when-not-answered",
    handler: callForwardingWhenNotAnswered,
  },
  {
    method: "POST",
    url: "/twilio-calls/play-hold-music",
    handler: playHoldMusic,
  },
  {
    method: "POST",
    url: "/get-incoming-calls",
    handler: getIncomingCallLogs,
  },
  {
    method: "POST",
    url: "/update-available-for-call",
    handler: updateAvailableForCall,
  },
  {
    method: "POST",
    url: "/get-SMS-logs",
    handler: smsLogs,
  },
  {
    method: "POST",
    url: "/get-call-flow-by-id",
    handler: getCallFlowDataById,
  },
  {
    method: "POST",
    url: "/get-call-settings",
    handler: getTwilioCallSettings,
  },
  {
    method: "POST",
    url: "/update-call-settings",
    handler: updateTwilioCallSettings,
  },
  {
    method: "POST",
    url: "/get-all-recordings",
    handler: getAllRecordingsList,
  },
  {
    method: "POST",
    url: "/get-analytics-data",
    handler: getAnalyticsData,
  },
  {
    method: "POST",
    url: "/im-tasks",
    handler: imTasks,
  },
  {
    method: "POST",
    url: "/call-flows",
    handler: callFlows,
  },
  {
    method: "POST",
    url: "/create-call-flow",
    handler: createCallFlow,
  },
  {
    method: "POST",
    url: "/edit-call-flow",
    handler: editCallFlow,
  },
  {
    method: "POST",
    url: "/activate-call-flow",
    handler: activateCallFlow,
  },
  {
    method: "POST",
    url: "/delete-call-flow",
    handler: deleteCallFlow,
  },
  {
    method: "POST",
    url: "/advance-call-flow-settings",
    handler: advanceCallFlowSettings,
  },
  {
    method: "POST",
    url: "/callforward",
    handler: callForwarding,
  },
  {
    method: "POST",
    url: "/getUserById",
    handler: getUserById,
  },
  {
    method: "POST",
    url: "/accept-reservation",
    handler: acceptReservation,
  },
  {
    method: "POST",
    url: "/conference-status-callback",
    handler: conferenceStatusCallback,
  },
  {
    method: "POST",
    url: "/assignment-callback",
    handler: assignmentCallback,
  },
  {
    method: "POST",
    url: "/initiate-message",
    handler: initiateMessage,
  },
  {
    method: "POST",
    url: "/incoming-message",
    handler: incomingMessage,
  },
  {
    method: "POST",
    url: "/twilio-calls/add-call-details-ajax",
    handler: addOutgoingCallDetailsAjax,
  },
  {
    method: "POST",
    url: "/twilio-calls/get-incoming-details",
    handler: getIncomingCallNumber,
  },
  {
    method: "POST",
    url: "/twilio-calls/add-incoming-call-details",
    handler: addIncomingCallDetails,
  },
  {
    method: "POST",
    url: "/twilio-calls/scan-crm-phone-number",
    handler: scanCrmPhoneNumber,
  },
];

module.exports = callCenterRoutes;
