using Microsoft.Extensions.DependencyInjection;

namespace Kbx.Shared.Integrations;

public static class KbxIntegrationRegistration
{
    public static IServiceCollection AddKbxIntegrations(this IServiceCollection services)
    {
        services.AddScoped<IKbxIntegrationAdapterRegistry, KbxIntegrationAdapterRegistry>();
        services.AddScoped<KbxIntegrationAttemptRepository>();
        services.AddScoped<KbxInboxReceiptStore>();
        services.AddSingleton<KbxPollyIntegrationPipeline>();
        services.AddScoped<KbxIntegrationOperationsProjector>();
        services.AddScoped<Shared.Operations.IWorkItemActionHandler, KbxIntegrationRetryActionHandler>();
        services.AddScoped<KbxOutboxIntegrationDispatcher>();
        return services;
    }
}
