using adas_core.Application.Repositories.Interfaces;
using adas_core.Authentication;
using adas_core.Authentication.Interfaces;
using adas_core.Infrastructure.Repositories;
using Microsoft.Extensions.DependencyInjection;

namespace adas_core.LocalLogin.RegistrationExtension;

/// <summary>
/// Extension class for registering local login services and repositories in the dependency injection container.
/// </summary>
public static class LocalLoginExtension
{
    /// <summary>
    /// Registers the local login services and repositories in the dependency injection container.
    /// </summary>
    /// <param name="serviceCollection">The service collection to which the services and repositories will be added.</param>
    public static void AddLocalLogin(this IServiceCollection serviceCollection)
    {
        serviceCollection.AddSingleton<ILocalLoginRepository, LocalLoginRepository>();
        serviceCollection.AddSingleton<IAuthorityRepository, AuthorityRepository>();
        serviceCollection.AddSingleton<ILoginService, LocalLoginServiceImpl>();
        serviceCollection.AddSingleton<IAuthorityService, AuthorityService>();
    }
}