using PARR.API.Settings;

namespace PARR.API.Installers
{
    /// <summary>
    /// Биндинги из конфига appsettings
    /// </summary>
    public static class SettingsInstaller
    {
        public static void InstallSettings(this IServiceCollection services, IConfiguration configuration)
        {
            var mqSettings = new MqSettings();
            configuration.GetSection(nameof(MqSettings)).Bind(mqSettings);
            services.AddSingleton(mqSettings);


            var userCacheSettings = new UserCacheSettings();
            configuration.GetSection(nameof(UserCacheSettings)).Bind(userCacheSettings);
            services.AddSingleton(userCacheSettings);


            var monitoringSettings = new MonitoringSettings();
            configuration.GetSection(nameof(MonitoringSettings)).Bind(monitoringSettings);
            services.AddSingleton(monitoringSettings);

            //TODO: add other
        }
    }
}
