using Autofac;
using e_suite.API.Common;
using e_suite.API.Common.repository;
using e_suite.DependencyInjection;
using e_suite.Modules.UserManager.Facade;
using e_suite.Modules.UserManager.Repository;
using e_suite.Modules.UserManager.Services;

namespace e_suite.Modules.UserManager;

public class IocRegistration : IIocRegistration
{
    public void RegisterTypes(ContainerBuilder builder)
    {
        builder.RegisterType<TwoFactorAuthenticatorFacade>().As<ITwoFactorAuthenticator>().SingleInstance();
        builder.RegisterType<RandomNumberGeneratorFacade>().As<IRandomNumberGenerator>().SingleInstance();
        builder.RegisterType<JwtService>().As<IJwtService>().SingleInstance();
        builder.RegisterType<UserManagerRepository>().As<IUserManagerRepository>().InstancePerLifetimeScope();
        builder.RegisterType<UserManagerMaintenance>().As<IUserManagerMaintenance>().InstancePerLifetimeScope();

        builder.RegisterType<UserManager>().As<IUserManager>().InstancePerLifetimeScope();
    }
}