mirror of
https://github.com/bitwarden/server.git
synced 2024-11-26 12:55:17 +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 PlanType Type { get; set; }
|
||||||
public short BaseUsers { get; set; }
|
public short BaseUsers { get; set; }
|
||||||
public bool CanBuyAdditionalUsers { get; set; }
|
public bool CanBuyAdditionalUsers { get; set; }
|
||||||
|
public short? MaxAdditionalUsers { get; set; }
|
||||||
public bool CanMonthly { get; set; }
|
public bool CanMonthly { get; set; }
|
||||||
public decimal BaseMonthlyPrice { get; set; }
|
public decimal BaseMonthlyPrice { get; set; }
|
||||||
public decimal UserMonthlyPrice { get; set; }
|
public decimal UserMonthlyPrice { get; set; }
|
||||||
|
@ -87,6 +87,12 @@ namespace Bit.Core.Services
|
|||||||
StripeCustomer customer = null;
|
StripeCustomer customer = null;
|
||||||
StripeSubscription subscription = 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)
|
if(plan.Type == Enums.PlanType.Free)
|
||||||
{
|
{
|
||||||
var ownerExistingOrgCount =
|
var ownerExistingOrgCount =
|
||||||
|
@ -106,6 +106,7 @@ namespace Bit.Core.Utilities
|
|||||||
BaseAnnualPrice = 12,
|
BaseAnnualPrice = 12,
|
||||||
UserAnnualPrice = 12,
|
UserAnnualPrice = 12,
|
||||||
CanBuyAdditionalUsers = true,
|
CanBuyAdditionalUsers = true,
|
||||||
|
MaxAdditionalUsers = 5,
|
||||||
CanMonthly = false,
|
CanMonthly = false,
|
||||||
Name = "Personal",
|
Name = "Personal",
|
||||||
StripeAnnualPlanId = "personal-annual",
|
StripeAnnualPlanId = "personal-annual",
|
||||||
|
Loading…
Reference in New Issue
Block a user