2024-06-03 11:00:52 -04:00
|
|
|
|
using Bit.Core.Billing.Caches;
|
|
|
|
|
|
using Bit.Core.Billing.Caches.Implementations;
|
2024-12-05 09:31:14 -05:00
|
|
|
|
using Bit.Core.Billing.Licenses.Extensions;
|
2025-02-27 07:55:46 -05:00
|
|
|
|
using Bit.Core.Billing.Pricing;
|
2024-06-03 11:00:52 -04:00
|
|
|
|
using Bit.Core.Billing.Services;
|
2024-05-23 10:17:00 -04:00
|
|
|
|
using Bit.Core.Billing.Services.Implementations;
|
2025-05-13 09:28:31 -04:00
|
|
|
|
using Bit.Core.Billing.Tax.Commands;
|
|
|
|
|
|
using Bit.Core.Billing.Tax.Services;
|
|
|
|
|
|
using Bit.Core.Billing.Tax.Services.Implementations;
|
2024-01-12 10:38:47 -05:00
|
|
|
|
|
|
|
|
|
|
namespace Bit.Core.Billing.Extensions;
|
|
|
|
|
|
|
|
|
|
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
|
|
|
|
|
|
|
|
|
|
public static class ServiceCollectionExtensions
|
|
|
|
|
|
{
|
2024-03-29 11:18:10 -04:00
|
|
|
|
public static void AddBillingOperations(this IServiceCollection services)
|
2024-01-12 10:38:47 -05:00
|
|
|
|
{
|
2025-01-02 20:27:53 +01:00
|
|
|
|
services.AddSingleton<ITaxService, TaxService>();
|
2024-05-23 10:17:00 -04:00
|
|
|
|
services.AddTransient<IOrganizationBillingService, OrganizationBillingService>();
|
2024-10-01 09:12:08 -04:00
|
|
|
|
services.AddTransient<IPremiumUserBillingService, PremiumUserBillingService>();
|
2024-06-03 11:00:52 -04:00
|
|
|
|
services.AddTransient<ISetupIntentCache, SetupIntentDistributedCache>();
|
2024-05-23 10:17:00 -04:00
|
|
|
|
services.AddTransient<ISubscriberService, SubscriberService>();
|
2025-04-02 19:47:48 +02:00
|
|
|
|
services.AddKeyedTransient<IAutomaticTaxStrategy, PersonalUseAutomaticTaxStrategy>(AutomaticTaxFactory.PersonalUse);
|
|
|
|
|
|
services.AddKeyedTransient<IAutomaticTaxStrategy, BusinessUseAutomaticTaxStrategy>(AutomaticTaxFactory.BusinessUse);
|
|
|
|
|
|
services.AddTransient<IAutomaticTaxFactory, AutomaticTaxFactory>();
|
2024-12-05 09:31:14 -05:00
|
|
|
|
services.AddLicenseServices();
|
2025-02-27 07:55:46 -05:00
|
|
|
|
services.AddPricingClient();
|
2025-05-13 09:28:31 -04:00
|
|
|
|
services.AddTransient<IPreviewTaxAmountCommand, PreviewTaxAmountCommand>();
|
2024-02-09 11:58:37 -05:00
|
|
|
|
}
|
2024-01-12 10:38:47 -05:00
|
|
|
|
}
|