From 9beeebaac50367e844a45ce89ab35b9612d7e57e Mon Sep 17 00:00:00 2001 From: Jonas Hendrickx Date: Wed, 6 Nov 2024 15:46:36 +0100 Subject: [PATCH] [PM-14456] Return provider type when getting provider's subscription (#4972) --- .../Controllers/ProviderBillingController.cs | 3 ++- .../Responses/ProviderSubscriptionResponse.cs | 13 +++++++++---- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/src/Api/Billing/Controllers/ProviderBillingController.cs b/src/Api/Billing/Controllers/ProviderBillingController.cs index eed7ed060..d2209685a 100644 --- a/src/Api/Billing/Controllers/ProviderBillingController.cs +++ b/src/Api/Billing/Controllers/ProviderBillingController.cs @@ -93,7 +93,8 @@ public class ProviderBillingController( subscription, providerPlans, taxInformation, - subscriptionSuspension); + subscriptionSuspension, + provider); return TypedResults.Ok(response); } diff --git a/src/Api/Billing/Models/Responses/ProviderSubscriptionResponse.cs b/src/Api/Billing/Models/Responses/ProviderSubscriptionResponse.cs index 79e2dc0e0..2b0592f0e 100644 --- a/src/Api/Billing/Models/Responses/ProviderSubscriptionResponse.cs +++ b/src/Api/Billing/Models/Responses/ProviderSubscriptionResponse.cs @@ -1,4 +1,6 @@ -using Bit.Core.Billing.Entities; +using Bit.Core.AdminConsole.Entities.Provider; +using Bit.Core.AdminConsole.Enums.Provider; +using Bit.Core.Billing.Entities; using Bit.Core.Billing.Enums; using Bit.Core.Billing.Models; using Bit.Core.Utilities; @@ -15,7 +17,8 @@ public record ProviderSubscriptionResponse( decimal AccountCredit, TaxInformation TaxInformation, DateTime? CancelAt, - SubscriptionSuspension Suspension) + SubscriptionSuspension Suspension, + ProviderType ProviderType) { private const string _annualCadence = "Annual"; private const string _monthlyCadence = "Monthly"; @@ -24,7 +27,8 @@ public record ProviderSubscriptionResponse( Subscription subscription, ICollection providerPlans, TaxInformation taxInformation, - SubscriptionSuspension subscriptionSuspension) + SubscriptionSuspension subscriptionSuspension, + Provider provider) { var providerPlanResponses = providerPlans .Where(providerPlan => providerPlan.IsConfigured()) @@ -56,7 +60,8 @@ public record ProviderSubscriptionResponse( accountCredit, taxInformation, subscription.CancelAt, - subscriptionSuspension); + subscriptionSuspension, + provider.Type); } }