using Autofac;
using PlanTempus.Core.SeqLogging;

namespace PlanTempus.Core.ModuleRegistry
{
    public class SeqLoggingModule : Module
    {
        public required SeqConfiguration SeqConfiguration { get; set; }

        protected override void Load(ContainerBuilder builder)
        {

            //builder.RegisterType<MessageChannel>()
            //  .As<IMessageChannel<Microsoft.ApplicationInsights.Channel.ITelemetry>>()
            //  .SingleInstance();

            builder.RegisterType<SeqBackgroundService>()
                //.As<Microsoft.Extensions.Hosting.IHostedService>()
                .SingleInstance();

            builder.RegisterGeneric(typeof(SeqLogger<>));

            builder.RegisterInstance(SeqConfiguration);

            builder.RegisterType<SeqHttpClient>()
              .As<SeqHttpClient>()
              .SingleInstance();

        }
    }
}
