mirror of
https://github.com/bitwarden/server.git
synced 2024-11-22 12:15:36 +01:00
max additional users check
This commit is contained in:
parent
cc7fd61c85
commit
6467cafde3
@ -13,6 +13,7 @@ namespace Bit.Core.Models.StaticStore
|
||||
public PlanType Type { get; set; }
|
||||
public short BaseUsers { get; set; }
|
||||
public bool CanBuyAdditionalUsers { get; set; }
|
||||
public short? MaxAdditionalUsers { get; set; }
|
||||
public bool CanMonthly { get; set; }
|
||||
public decimal BaseMonthlyPrice { get; set; }
|
||||
public decimal UserMonthlyPrice { get; set; }
|
||||
|
@ -87,6 +87,12 @@ namespace Bit.Core.Services
|
||||
StripeCustomer customer = null;
|
||||
StripeSubscription subscription = null;
|
||||
|
||||
if(signup.AdditionalUsers > plan.MaxAdditionalUsers.GetValueOrDefault(0))
|
||||
{
|
||||
throw new BadRequestException($"Selected plan allows a maximum of " +
|
||||
$"{plan.MaxAdditionalUsers.GetValueOrDefault(0)} additional users.");
|
||||
}
|
||||
|
||||
if(plan.Type == Enums.PlanType.Free)
|
||||
{
|
||||
var ownerExistingOrgCount =
|
||||
|
@ -106,6 +106,7 @@ namespace Bit.Core.Utilities
|
||||
BaseAnnualPrice = 12,
|
||||
UserAnnualPrice = 12,
|
||||
CanBuyAdditionalUsers = true,
|
||||
MaxAdditionalUsers = 5,
|
||||
CanMonthly = false,
|
||||
Name = "Personal",
|
||||
StripeAnnualPlanId = "personal-annual",
|
||||
|
Loading…
Reference in New Issue
Block a user