1
0
mirror of https://github.com/bitwarden/server.git synced 2025-06-30 15:42:48 -05:00

[AC-2947] Fix provider account credit display (#4590)

* Fix provider account credit

* Fix test
This commit is contained in:
Alex Morask
2024-08-05 11:02:17 -04:00
committed by GitHub
parent 1f09233760
commit a2e1eb79d2
2 changed files with 6 additions and 4 deletions

View File

@ -11,7 +11,7 @@ public record ProviderSubscriptionResponse(
decimal? DiscountPercentage,
string CollectionMethod,
IEnumerable<ProviderPlanResponse> Plans,
long AccountCredit,
decimal AccountCredit,
TaxInformation TaxInformation,
DateTime? CancelAt,
SubscriptionSuspension Suspension)
@ -42,13 +42,15 @@ public record ProviderSubscriptionResponse(
cadence);
});
var accountCredit = Convert.ToDecimal(subscription.Customer?.Balance) * -1 / 100;
return new ProviderSubscriptionResponse(
subscription.Status,
subscription.CurrentPeriodEnd,
subscription.Customer?.Discount?.Coupon?.PercentOff,
subscription.CollectionMethod,
providerPlanResponses,
subscription.Customer?.Balance ?? 0,
accountCredit,
taxInformation,
subscription.CancelAt,
subscriptionSuspension);