From e3cc1b94113f46d0f56e75e3e76e9f91f138aa4e Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Fri, 7 Apr 2017 16:25:17 -0400 Subject: [PATCH] adjust plans and add max subvaults to orgs --- src/Core/Models/StaticStore/Plan.cs | 2 -- src/Core/Models/Table/Organization.cs | 1 + src/Core/Utilities/StaticStore.cs | 7 ++----- src/Sql/dbo/Stored Procedures/Organization_Create.sql | 3 +++ src/Sql/dbo/Stored Procedures/Organization_Update.sql | 2 ++ src/Sql/dbo/Tables/Organization.sql | 1 + 6 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/Core/Models/StaticStore/Plan.cs b/src/Core/Models/StaticStore/Plan.cs index 5b8386845b..a5241434c3 100644 --- a/src/Core/Models/StaticStore/Plan.cs +++ b/src/Core/Models/StaticStore/Plan.cs @@ -18,8 +18,6 @@ namespace Bit.Core.Models.StaticStore public decimal UserMonthlyPrice { get; set; } public decimal BaseAnnualPrice { get; set; } public decimal UserAnnualPrice { get; set; } - public TimeSpan? Trial { get; set; } - public Func Cycle { get; set; } public bool Disabled { get; set; } } } diff --git a/src/Core/Models/Table/Organization.cs b/src/Core/Models/Table/Organization.cs index f7995673c8..4ad05e37b1 100644 --- a/src/Core/Models/Table/Organization.cs +++ b/src/Core/Models/Table/Organization.cs @@ -13,6 +13,7 @@ namespace Bit.Core.Models.Table public string Plan { get; set; } public PlanType PlanType { get; set; } public short MaxUsers { get; set; } + public short? MaxSubvaults { get; set; } public string StripeCustomerId { get; set; } public string StripeSubscriptionId { get; set; } public DateTime CreationDate { get; internal set; } = DateTime.UtcNow; diff --git a/src/Core/Utilities/StaticStore.cs b/src/Core/Utilities/StaticStore.cs index d7ab7f230a..daa267c27d 100644 --- a/src/Core/Utilities/StaticStore.cs +++ b/src/Core/Utilities/StaticStore.cs @@ -94,7 +94,7 @@ namespace Bit.Core.Utilities new Plan { Type = PlanType.Free, - BaseUsers = 1, + BaseUsers = 2, CanBuyAdditionalUsers = false, Name = "Free" }, @@ -105,8 +105,7 @@ namespace Bit.Core.Utilities BaseAnnualPrice = 12, UserAnnualPrice = 12, CanBuyAdditionalUsers = true, - Trial = new TimeSpan(14, 0, 0, 0), - Cycle = now => now.AddYears(1) - now, + CanMonthly = false, Name = "Personal", StripeAnnualPlanId = "personal-annual", StripeAnnualUserPlanId = "personal-user-annual" @@ -121,8 +120,6 @@ namespace Bit.Core.Utilities UserMonthlyPrice = 2.5M, CanBuyAdditionalUsers = true, CanMonthly = true, - Trial = new TimeSpan(14, 0, 0, 0), - Cycle = now => now.AddMonths(1) - now, Name = "Teams", StripeAnnualPlanId = "teams-annual", StripeAnnualUserPlanId = "teams-user-annual", diff --git a/src/Sql/dbo/Stored Procedures/Organization_Create.sql b/src/Sql/dbo/Stored Procedures/Organization_Create.sql index 89e9bea0aa..bc1e3fc985 100644 --- a/src/Sql/dbo/Stored Procedures/Organization_Create.sql +++ b/src/Sql/dbo/Stored Procedures/Organization_Create.sql @@ -6,6 +6,7 @@ @Plan NVARCHAR(20), @PlanType TINYINT, @MaxUsers SMALLINT, + @MaxSubvaults SMALLINT, @StripeCustomerId VARCHAR(50), @StripeSubscriptionId VARCHAR(50), @CreationDate DATETIME2(7), @@ -23,6 +24,7 @@ BEGIN [Plan], [PlanType], [MaxUsers], + [MaxSubvaults], [StripeCustomerId], [StripeSubscriptionId], [CreationDate], @@ -37,6 +39,7 @@ BEGIN @Plan, @PlanType, @MaxUsers, + @MaxSubvaults, @StripeCustomerId, @StripeSubscriptionId, @CreationDate, diff --git a/src/Sql/dbo/Stored Procedures/Organization_Update.sql b/src/Sql/dbo/Stored Procedures/Organization_Update.sql index a8eb69f6c4..b5b4d16d13 100644 --- a/src/Sql/dbo/Stored Procedures/Organization_Update.sql +++ b/src/Sql/dbo/Stored Procedures/Organization_Update.sql @@ -6,6 +6,7 @@ @Plan NVARCHAR(20), @PlanType TINYINT, @MaxUsers SMALLINT, + @MaxSubvaults SMALLINT, @StripeCustomerId VARCHAR(50), @StripeSubscriptionId VARCHAR(50), @CreationDate DATETIME2(7), @@ -24,6 +25,7 @@ BEGIN [Plan] = @Plan, [PlanType] = @PlanType, [MaxUsers] = @MaxUsers, + [MaxSubvaults] = @MaxSubvaults, [StripeCustomerId] = @StripeCustomerId, [StripeSubscriptionId] = @StripeSubscriptionId, [CreationDate] = @CreationDate, diff --git a/src/Sql/dbo/Tables/Organization.sql b/src/Sql/dbo/Tables/Organization.sql index 4321c8cb93..f4b998b65e 100644 --- a/src/Sql/dbo/Tables/Organization.sql +++ b/src/Sql/dbo/Tables/Organization.sql @@ -6,6 +6,7 @@ [Plan] NVARCHAR (20) NOT NULL, [PlanType] TINYINT NOT NULL, [MaxUsers] SMALLINT NULL, + [MaxSubvaults] SMALLINT NULL, [StripeCustomerId] VARCHAR (50) NULL, [StripeSubscriptionId] VARCHAR (50) NULL, [CreationDate] DATETIME2 (7) NOT NULL,