1
0
mirror of https://github.com/bitwarden/server.git synced 2025-07-02 16:42:50 -05:00

org signup plan details

This commit is contained in:
Kyle Spearrin
2017-04-04 12:57:50 -04:00
parent a4ef7c906e
commit f52c0798cd
15 changed files with 218 additions and 84 deletions

View File

@ -31,4 +31,4 @@ BEGIN
[CanEdit] = 1
RETURN @CanEdit
END
END

View File

@ -21,4 +21,4 @@ BEGIN
[Date] > @SinceRevisionDate
AND [Event] = 2 -- Only cipher delete events.
AND [UserId] = @UserId
END
END

View File

@ -2,13 +2,19 @@
@Id UNIQUEIDENTIFIER,
@UserId UNIQUEIDENTIFIER,
@Name NVARCHAR(50),
@BusinessName NVARCHAR(50),
@BillingEmail NVARCHAR(50),
@Plan NVARCHAR(20),
@PlanType TINYINT,
@PlanPrice MONEY,
@PlanRenewalPrice MONEY,
@PlanBasePrice MONEY,
@PlanUserPrice MONEY,
@PlanRenewalDate DATETIME2(7),
@PlanTrial BIT,
@BaseUsers SMALLINT,
@AdditionalUsers SMALLINT,
@MaxUsers SMALLINT,
@StripeCustomerId VARCHAR(50),
@StripeSubscriptionId VARCHAR(50),
@CreationDate DATETIME2(7),
@RevisionDate DATETIME2(7)
AS
@ -20,13 +26,19 @@ BEGIN
[Id],
[UserId],
[Name],
[BusinessName],
[BillingEmail],
[Plan],
[PlanType],
[PlanPrice],
[PlanRenewalPrice],
[PlanBasePrice],
[PlanUserPrice],
[PlanRenewalDate],
[PlanTrial],
[BaseUsers],
[AdditionalUsers],
[MaxUsers],
[StripeCustomerId],
[StripeSubscriptionId],
[CreationDate],
[RevisionDate]
)
@ -35,13 +47,19 @@ BEGIN
@Id,
@UserId,
@Name,
@BusinessName,
@BillingEmail,
@Plan,
@PlanType,
@PlanPrice,
@PlanRenewalPrice,
@PlanBasePrice,
@PlanUserPrice,
@PlanRenewalDate,
@PlanTrial,
@BaseUsers,
@AdditionalUsers,
@MaxUsers,
@StripeCustomerId,
@StripeSubscriptionId,
@CreationDate,
@RevisionDate
)

View File

@ -2,15 +2,22 @@
@Id UNIQUEIDENTIFIER,
@UserId UNIQUEIDENTIFIER,
@Name NVARCHAR(50),
@BusinessName NVARCHAR(50),
@BillingEmail NVARCHAR(50),
@Plan NVARCHAR(20),
@PlanType TINYINT,
@PlanPrice MONEY,
@PlanRenewalPrice MONEY,
@PlanBasePrice MONEY,
@PlanUserPrice MONEY,
@PlanRenewalDate DATETIME2(7),
@PlanTrial BIT,
@BaseUsers SMALLINT,
@AdditionalUsers SMALLINT,
@MaxUsers SMALLINT,
@StripeCustomerId VARCHAR(50),
@StripeSubscriptionId VARCHAR(50),
@CreationDate DATETIME2(7),
@RevisionDate DATETIME2(7)
AS
BEGIN
SET NOCOUNT ON
@ -20,13 +27,19 @@ BEGIN
SET
[UserId] = @UserId,
[Name] = @Name,
[BusinessName] = @BusinessName,
[BillingEmail] = @BillingEmail,
[Plan] = @Plan,
[PlanType] = @PlanType,
[PlanPrice] = @PlanPrice,
[PlanRenewalPrice] = @PlanRenewalPrice,
[PlanBasePrice] = @PlanBasePrice,
[PlanUserPrice] = @PlanUserPrice,
[PlanRenewalDate] = @PlanRenewalDate,
[PlanTrial] = @PlanTrial,
[BaseUsers] = @BaseUsers,
[AdditionalUsers] = @AdditionalUsers,
[MaxUsers] = @MaxUsers,
[StripeCustomerId] = @StripeCustomerId,
[StripeSubscriptionId] = @StripeSubscriptionId,
[CreationDate] = @CreationDate,
[RevisionDate] = @RevisionDate
WHERE

View File

@ -15,4 +15,4 @@ BEGIN
WHERE
OU.[UserId] = @UserId
AND OU.[Status] = 2 -- Confirmed
END
END

View File

@ -7,4 +7,4 @@ BEGIN
SELECT
[dbo].[UserCanEditCipher](@UserId, @CipherId)
END
END

View File

@ -15,4 +15,4 @@ BEGIN
WHERE
OU.[UserId] = @UserId
AND OU.[Status] = 2 -- Confirmed
END
END

View File

@ -1,16 +1,22 @@
CREATE TABLE [dbo].[Organization] (
[Id] UNIQUEIDENTIFIER NOT NULL,
[UserId] UNIQUEIDENTIFIER NOT NULL,
[Name] NVARCHAR (50) NOT NULL,
[Plan] NVARCHAR (20) NOT NULL,
[PlanType] TINYINT NOT NULL,
[PlanPrice] MONEY NOT NULL,
[PlanRenewalPrice] MONEY NOT NULL,
[PlanRenewalDate] DATETIME2 (7) NULL,
[PlanTrial] BIT NOT NULL,
[MaxUsers] SMALLINT NULL,
[CreationDate] DATETIME2 (7) NOT NULL,
[RevisionDate] DATETIME2 (7) NOT NULL,
[Id] UNIQUEIDENTIFIER NOT NULL,
[UserId] UNIQUEIDENTIFIER NOT NULL,
[Name] NVARCHAR (50) NOT NULL,
[BusinessName] NVARCHAR (50) NULL,
[BillingEmail] NVARCHAR (50) NOT NULL,
[Plan] NVARCHAR (20) NOT NULL,
[PlanType] TINYINT NOT NULL,
[PlanBasePrice] MONEY NOT NULL,
[PlanUserPrice] MONEY NOT NULL,
[PlanRenewalDate] DATETIME2 (7) NULL,
[PlanTrial] BIT NOT NULL,
[BaseUsers] SMALLINT NULL,
[AdditionalUsers] SMALLINT NULL,
[MaxUsers] SMALLINT NULL,
[StripeCustomerId] VARCHAR (50) NULL,
[StripeSubscriptionId] VARCHAR (50) NULL,
[CreationDate] DATETIME2 (7) NOT NULL,
[RevisionDate] DATETIME2 (7) NOT NULL,
CONSTRAINT [PK_Organization] PRIMARY KEY CLUSTERED ([Id] ASC),
CONSTRAINT [FK_Organization_User] FOREIGN KEY ([UserId]) REFERENCES [dbo].[User] ([Id])
);