using Common.Contracts.Infrastructure;
using Hushian.Application.Contracts;
using Hushian.Application.Models.aia;
using Hushian.Application.Models.Message;
using Hushian.Infrastructure.Ai_Ass;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
namespace Hushian.Infrastructure
{
    public static class InfrastractureServicesRegistration
    {
        public static IServiceCollection ConfigureInfrastractureServices(this IServiceCollection services,
        IConfiguration configuration)
        {

          //  services.Configure<EmailSetting>(configuration.GetSection("EmailSettings"));
            //services.AddTransient<IEmailSender, EmailSender>();

            services.Configure<MessageSetting>(configuration.GetSection("MessageSettings"));
            services.AddTransient<IMessageSender, MessageSender>();


            services.Configure<aiSetting>(configuration.GetSection("aiSettings"));
            services.Configure<aigrpcserver>(configuration.GetSection("aigrpcserver"));
            services.AddTransient<Iaiass, openAI>();

            services.AddScoped(c => new Melipayamak.RestClient(configuration.GetSection("MessageSettings:UserName").Value, configuration.GetSection("MessageSettings:Password").Value));
            return services;
        }
    }
}
