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

Added percent off to discount, removed discount from user sub (#3326)

This commit is contained in:
Alex Morask
2023-10-23 10:02:02 -04:00
committed by GitHub
parent d7c544a116
commit 19e2215376
4 changed files with 10 additions and 8 deletions

View File

@ -13,7 +13,6 @@ public class SubscriptionResponseModel : ResponseModel
Subscription = subscription.Subscription != null ? new BillingSubscription(subscription.Subscription) : null;
UpcomingInvoice = subscription.UpcomingInvoice != null ?
new BillingSubscriptionUpcomingInvoice(subscription.UpcomingInvoice) : null;
Discount = subscription.Discount != null ? new BillingCustomerDiscount(subscription.Discount) : null;
StorageName = user.Storage.HasValue ? CoreHelpers.ReadableBytesSize(user.Storage.Value) : null;
StorageGb = user.Storage.HasValue ? Math.Round(user.Storage.Value / 1073741824D, 2) : 0; // 1 GB
MaxStorageGb = user.MaxStorageGb;
@ -41,7 +40,6 @@ public class SubscriptionResponseModel : ResponseModel
public short? MaxStorageGb { get; set; }
public BillingSubscriptionUpcomingInvoice UpcomingInvoice { get; set; }
public BillingSubscription Subscription { get; set; }
public BillingCustomerDiscount Discount { get; set; }
public UserLicense License { get; set; }
public DateTime? Expiration { get; set; }
public bool UsingInAppPurchase { get; set; }
@ -53,10 +51,12 @@ public class BillingCustomerDiscount
{
Id = discount.Id;
Active = discount.Active;
PercentOff = discount.PercentOff;
}
public string Id { get; set; }
public bool Active { get; set; }
public string Id { get; }
public bool Active { get; }
public decimal? PercentOff { get; }
}
public class BillingSubscription