using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using PARR.BLL.Services.Implementations;
using PARR.BLL.Services.Interfaces;
using PARR.BLL.Settings;

namespace PARR.BLL
{
    public static class ParrBllInstaller
    {
        public static void InstallBllServices(this IServiceCollection services, IConfiguration configuration)
        {

            var storageSettings = new StorageSettings();
            configuration.GetSection(nameof(StorageSettings)).Bind(storageSettings);
            services.AddSingleton(storageSettings);


            services.AddTransient<IFileService, FileService>();

            //services.AddTransient<IMqService, MqService>();
            services.AddTransient<IMqService, MqServiceV2>();

            services.AddHttpClient<IMqAdminService, MqAdminService>();
            services.AddTransient<ITransformService, TransformService>();
            services.AddTransient<IIntervalService, IntervalService>();
            services.AddTransient<ICalendarService, CalendarService>();
            services.AddTransient<ITemplateMaskValidator, TemplateMaskValidator>();
        }
    }
}
