using Microsoft.Extensions.DependencyInjection;
using Tiku.Application.Commerce;
using Tiku.Application.Growth;
using Tiku.Application.Jobs;
using Tiku.Application.Notifications;
using Tiku.Application.Points;
using Tiku.Infrastructure.Commerce;
using Tiku.Infrastructure.Commerce.Reconciliation;
using Tiku.Infrastructure.Growth;
using Tiku.Infrastructure.Notifications;
using Tiku.Infrastructure.Points;

namespace Tiku.Infrastructure;

internal static class CommerceModule
{
    internal static IServiceCollection AddCommerceModule(this IServiceCollection services)
    {
        services.AddScoped<ICommerceService, CommerceService>();
        services.AddScoped<ICommerceAdminService, CommerceAdminService>();
        services.AddScoped<IBackgroundJobHandler, CommerceReconciliationJobHandler>();
        services.AddScoped<IPointService, PointService>();
        services.AddScoped<IReferralQrcodeGenerator, ReferralQrcodeGenerator>();
        services.AddScoped<IReferralService, ReferralService>();
        services.AddScoped<ICrmService, CrmService>();
        services.AddScoped<ICommissionService, CommissionService>();
        services.AddScoped<INotificationProvider, InAppNotificationProvider>();
        services.AddSingleton<ITenantSecretProtector, TenantSecretProtector>();
        services.AddScoped<ITenantSecretService, TenantSecretService>();
        services.AddScoped<IPaymentProviderConfigService, PaymentProviderConfigService>();
        services.AddScoped<IPaymentProviderGateway, PaymentProviderGateway>();
        services.AddScoped<IPaymentProvider, ManualPaymentProvider>();
        services.AddScoped<IPaymentProvider, WechatPayProvider>();
        services.AddScoped<IPaymentProvider, AlipayProvider>();
        return services;
    }
}
