mirror of
https://github.com/bitwarden/server.git
synced 2025-04-05 05:00:19 -05:00
29 lines
1.3 KiB
C#
29 lines
1.3 KiB
C#
using Bit.Core.Billing.Caches;
|
|
using Bit.Core.Billing.Caches.Implementations;
|
|
using Bit.Core.Billing.Licenses.Extensions;
|
|
using Bit.Core.Billing.Pricing;
|
|
using Bit.Core.Billing.Services;
|
|
using Bit.Core.Billing.Services.Implementations;
|
|
using Bit.Core.Billing.Services.Implementations.AutomaticTax;
|
|
|
|
namespace Bit.Core.Billing.Extensions;
|
|
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
|
|
public static class ServiceCollectionExtensions
|
|
{
|
|
public static void AddBillingOperations(this IServiceCollection services)
|
|
{
|
|
services.AddSingleton<ITaxService, TaxService>();
|
|
services.AddTransient<IOrganizationBillingService, OrganizationBillingService>();
|
|
services.AddTransient<IPremiumUserBillingService, PremiumUserBillingService>();
|
|
services.AddTransient<ISetupIntentCache, SetupIntentDistributedCache>();
|
|
services.AddTransient<ISubscriberService, SubscriberService>();
|
|
services.AddKeyedTransient<IAutomaticTaxStrategy, PersonalUseAutomaticTaxStrategy>(AutomaticTaxFactory.PersonalUse);
|
|
services.AddKeyedTransient<IAutomaticTaxStrategy, BusinessUseAutomaticTaxStrategy>(AutomaticTaxFactory.BusinessUse);
|
|
services.AddTransient<IAutomaticTaxFactory, AutomaticTaxFactory>();
|
|
services.AddLicenseServices();
|
|
services.AddPricingClient();
|
|
}
|
|
}
|