using e_suite.Messaging.Common.models;
using Microsoft.Extensions.Configuration;

namespace e_suite.Messaging.Common;

public class SigmaImportMessageSender : MessageSenderBase, ISigmaImportMessageSender
{
    public SigmaImportMessageSender(IConfiguration configuration, IRabbitMqConnectionFactory connectionFactory) : base(
        configuration, connectionFactory, MessageQueueNames.SigmaImport)
    {

    }

    public void PostImportGMGProfiles()
    {
        var message = new SigmaImportMessage
        {
            MessageType = SigmaImportMessageTypes.ImportGMGProfiles
        };

        Task.Run(async () =>
        {
            await PostMessage(message);
        }).Wait();
    }

    public void PostImportPrintSpecifications()
    {
        var message = new SigmaImportMessage
        {
            MessageType = SigmaImportMessageTypes.ImportPrintSpecifications
        };

        Task.Run(async () =>
        {
            await PostMessage(message);
        }).Wait();
    }
}