diff --git a/src/Core/Models/StaticStore/Plan.cs b/src/Core/Models/StaticStore/Plan.cs index d70b58d94..e928986ef 100644 --- a/src/Core/Models/StaticStore/Plan.cs +++ b/src/Core/Models/StaticStore/Plan.cs @@ -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; } diff --git a/src/Core/Services/Implementations/OrganizationService.cs b/src/Core/Services/Implementations/OrganizationService.cs index ce4735807..db0eefc70 100644 --- a/src/Core/Services/Implementations/OrganizationService.cs +++ b/src/Core/Services/Implementations/OrganizationService.cs @@ -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 = diff --git a/src/Core/Utilities/StaticStore.cs b/src/Core/Utilities/StaticStore.cs index ef48888f9..aab327a49 100644 --- a/src/Core/Utilities/StaticStore.cs +++ b/src/Core/Utilities/StaticStore.cs @@ -106,6 +106,7 @@ namespace Bit.Core.Utilities BaseAnnualPrice = 12, UserAnnualPrice = 12, CanBuyAdditionalUsers = true, + MaxAdditionalUsers = 5, CanMonthly = false, Name = "Personal", StripeAnnualPlanId = "personal-annual",