using Tiku.Api.Middleware;
using Tiku.Api.Modules.Platform.Errors;
using Tiku.Api.Modules.Student.Content.Errors;
using Tiku.Api.Modules.Student.Learning.Errors;
using Tiku.Api.Modules.System.Auth.Errors;
using Tiku.Api.Modules.System.Jobs.Errors;
using Tiku.Api.Modules.System.Storage.Errors;
using Tiku.Api.Modules.Tenant.Commerce.Errors;
using Tiku.Api.Modules.Tenant.Management.Errors;
using Tiku.Api.Modules.Tenant.Tenancy.Errors;

namespace Tiku.Api.Configuration;

internal static class ExceptionProblemDetailsExtensions
{
    internal static IServiceCollection AddExceptionProblemDetailsMappers(this IServiceCollection services)
    {
        services.AddSingleton<IExceptionProblemDetailsMapper, AuthExceptionProblemDetailsMapper>();
        services.AddSingleton<IExceptionProblemDetailsMapper, TenancyExceptionProblemDetailsMapper>();
        services.AddSingleton<IExceptionProblemDetailsMapper, JobsExceptionProblemDetailsMapper>();
        services.AddSingleton<IExceptionProblemDetailsMapper, ContentExceptionProblemDetailsMapper>();
        services.AddSingleton<IExceptionProblemDetailsMapper, LearningExceptionProblemDetailsMapper>();
        services.AddSingleton<IExceptionProblemDetailsMapper, CommerceExceptionProblemDetailsMapper>();
        services.AddSingleton<IExceptionProblemDetailsMapper, TenantAdminExceptionProblemDetailsMapper>();
        services.AddSingleton<IExceptionProblemDetailsMapper, PlatformExceptionProblemDetailsMapper>();
        services.AddSingleton<IExceptionProblemDetailsMapper, StorageExceptionProblemDetailsMapper>();
        return services;
    }
}
