const queueDispatcher = require('../../core/whatsapp/QueueDispatcher');
const { WebMessageSender } = require('./WebMessageSender');
const { send: sendCloud } = require('./CloudMessageSender');
const { registerWhatsAppModules } = require('../../modules/whatsapp');

const initializeMessagePipeline = ({ whatsappService }) => {
  queueDispatcher.registerSender('web', new WebMessageSender(whatsappService));
  queueDispatcher.registerSender('cloud', { send: sendCloud });
  registerWhatsAppModules({ whatsappService });
};

module.exports = { initializeMessagePipeline };
