mirror of
https://github.com/bitwarden/server.git
synced 2025-07-04 17:42:49 -05:00
[AC-1843] Automate PM discount for SM Trial (#3661)
* Added appliesTo to customer discount. Added productId to subscription item * Added IsFromSecretsManagerTrial flag to add discount for SM trials * Fixed broken tests --------- Co-authored-by: Alex Morask <amorask@bitwarden.com>
This commit is contained in:
@ -46,6 +46,7 @@ public class OrganizationCreateRequestModel : IValidatableObject
|
||||
public int? AdditionalServiceAccounts { get; set; }
|
||||
[Required]
|
||||
public bool UseSecretsManager { get; set; }
|
||||
public bool IsFromSecretsManagerTrial { get; set; }
|
||||
|
||||
public virtual OrganizationSignup ToOrganizationSignup(User user)
|
||||
{
|
||||
@ -67,6 +68,7 @@ public class OrganizationCreateRequestModel : IValidatableObject
|
||||
AdditionalSmSeats = AdditionalSmSeats.GetValueOrDefault(),
|
||||
AdditionalServiceAccounts = AdditionalServiceAccounts.GetValueOrDefault(),
|
||||
UseSecretsManager = UseSecretsManager,
|
||||
IsFromSecretsManagerTrial = IsFromSecretsManagerTrial,
|
||||
TaxInfo = new TaxInfo
|
||||
{
|
||||
TaxIdNumber = TaxIdNumber,
|
||||
|
@ -50,11 +50,13 @@ public class BillingCustomerDiscount
|
||||
Id = discount.Id;
|
||||
Active = discount.Active;
|
||||
PercentOff = discount.PercentOff;
|
||||
AppliesTo = discount.AppliesTo;
|
||||
}
|
||||
|
||||
public string Id { get; }
|
||||
public bool Active { get; }
|
||||
public decimal? PercentOff { get; }
|
||||
public List<string> AppliesTo { get; }
|
||||
}
|
||||
|
||||
public class BillingSubscription
|
||||
@ -89,6 +91,7 @@ public class BillingSubscription
|
||||
{
|
||||
public BillingSubscriptionItem(SubscriptionInfo.BillingSubscription.BillingSubscriptionItem item)
|
||||
{
|
||||
ProductId = item.ProductId;
|
||||
Name = item.Name;
|
||||
Amount = item.Amount;
|
||||
Interval = item.Interval;
|
||||
@ -97,6 +100,7 @@ public class BillingSubscription
|
||||
AddonSubscriptionItem = item.AddonSubscriptionItem;
|
||||
}
|
||||
|
||||
public string ProductId { get; set; }
|
||||
public string Name { get; set; }
|
||||
public decimal Amount { get; set; }
|
||||
public int Quantity { get; set; }
|
||||
|
Reference in New Issue
Block a user