mirror of
https://github.com/bitwarden/server.git
synced 2025-04-04 20:50:21 -05:00

* Pm 19147 2 (#5544) * Pm 19147 2 (#5544) * Unit tests for tax strategies `GetUpdateOptions` * Only allow automatic tax flag to be updated for complete subscription updates such as plan changes, not when upgrading additional storage, seats, etc * unit tests for factory * Fix build * Automatic tax for tax estimation * Fix stub * Fix stub * "customer.tax_ids" isn't expanded in some flows. * Fix SubscriberServiceTests.cs * BusinessUseAutomaticTaxStrategy > SetUpdateOptions tests * Fix ProviderBillingServiceTests.cs
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();
|
|
}
|
|
}
|