1
0
mirror of https://github.com/bitwarden/server.git synced 2025-06-30 23:52:50 -05:00

Return discount info in Subscription responses [AC-1657] (#3278)

* Return whether customer has Stripe discount applied from /api/accounts/subscription

* Return whether customer has Stripe discount applied from /api/organizations/{id}/subscription
This commit is contained in:
Alex Morask
2023-09-29 12:29:43 -04:00
committed by GitHub
parent 12b03482ae
commit 46117b194e
4 changed files with 42 additions and 2 deletions

View File

@ -5,10 +5,25 @@ namespace Bit.Core.Models.Business;
public class SubscriptionInfo
{
public BillingCustomerDiscount Discount { get; set; }
public BillingSubscription Subscription { get; set; }
public BillingUpcomingInvoice UpcomingInvoice { get; set; }
public bool UsingInAppPurchase { get; set; }
public class BillingCustomerDiscount
{
public BillingCustomerDiscount() { }
public BillingCustomerDiscount(Discount discount)
{
Id = discount.Id;
Active = discount.Start != null && discount.End == null;
}
public string Id { get; }
public bool Active { get; }
}
public class BillingSubscription
{
public BillingSubscription(Subscription sub)