1
0
mirror of https://github.com/bitwarden/server.git synced 2025-07-01 16:12:49 -05:00

[AC-2420] Fix customer discount ID and SM invite validation (#3966)

* Fix customer discount ID and SM update validation

* Replace constructor needed for autofixture
This commit is contained in:
Alex Morask
2024-04-18 11:11:37 -04:00
committed by GitHub
parent 49ed5af517
commit 9827ee5f6a
5 changed files with 17 additions and 25 deletions

View File

@ -14,16 +14,16 @@ public class SubscriptionInfo
public BillingCustomerDiscount(Discount discount)
{
Id = discount.Id;
Active = discount.Start != null && discount.End == null;
Id = discount.Coupon?.Id;
Active = discount.End == null;
PercentOff = discount.Coupon?.PercentOff;
AppliesTo = discount.Coupon?.AppliesTo?.Products ?? new List<string>();
AppliesTo = discount.Coupon?.AppliesTo?.Products ?? [];
}
public string Id { get; }
public bool Active { get; }
public decimal? PercentOff { get; }
public List<string> AppliesTo { get; }
public string Id { get; set; }
public bool Active { get; set; }
public decimal? PercentOff { get; set; }
public List<string> AppliesTo { get; set; }
}
public class BillingSubscription