using e_suite.Messaging.Common;
using e_suite.Scheduler.Scheduler;
using Microsoft.Extensions.Logging;

namespace e_suite.Scheduler.Jobs;

[Daily(hour: 1, minute: 15)]
public class NightlySigmaImport : IJob
{
    private readonly ISigmaImportMessageSender _sigmaImportMessageSender;

    private readonly ILogger _logger;

    public NightlySigmaImport(ISigmaImportMessageSender sigmaImportMessageSender, ILogger logger)
    {
        _sigmaImportMessageSender = sigmaImportMessageSender;
        _logger = logger;
    }

    public Task ExecuteAsync()
    {
        _sigmaImportMessageSender.PostImportGMGProfiles();
        _sigmaImportMessageSender.PostImportPrintSpecifications();
        _logger.LogInformation("NightlySigmaImport messages sent");
        return Task.CompletedTask;
    }
}