diff --git a/src/Core/Models/Table/Organization.cs b/src/Core/Models/Table/Organization.cs index e0ba24829e..d54c13b92a 100644 --- a/src/Core/Models/Table/Organization.cs +++ b/src/Core/Models/Table/Organization.cs @@ -27,6 +27,7 @@ namespace Bit.Core.Models.Table public string GatewaySubscriptionId { get; set; } public bool Enabled { get; set; } = true; public string LicenseKey { get; set; } + public DateTime? ExpirationDate { get; set; } public DateTime CreationDate { get; internal set; } = DateTime.UtcNow; public DateTime RevisionDate { get; internal set; } = DateTime.UtcNow; diff --git a/src/Core/Models/Table/User.cs b/src/Core/Models/Table/User.cs index f242bccf8c..b4afa4dc89 100644 --- a/src/Core/Models/Table/User.cs +++ b/src/Core/Models/Table/User.cs @@ -30,6 +30,7 @@ namespace Bit.Core.Models.Table public string PublicKey { get; set; } public string PrivateKey { get; set; } public bool Premium { get; set; } + public DateTime? PremiumExpirationDate { get; set; } public long? Storage { get; set; } public short? MaxStorageGb { get; set; } public GatewayType? Gateway { get; set; } diff --git a/src/Sql/dbo/Stored Procedures/Organization_Create.sql b/src/Sql/dbo/Stored Procedures/Organization_Create.sql index 635ffc34f1..d06266b2f1 100644 --- a/src/Sql/dbo/Stored Procedures/Organization_Create.sql +++ b/src/Sql/dbo/Stored Procedures/Organization_Create.sql @@ -18,6 +18,7 @@ @GatewaySubscriptionId VARCHAR(50), @Enabled BIT, @LicenseKey VARCHAR(100), + @ExpirationDate DATETIME2(7), @CreationDate DATETIME2(7), @RevisionDate DATETIME2(7) AS @@ -45,6 +46,7 @@ BEGIN [GatewaySubscriptionId], [Enabled], [LicenseKey], + [ExpirationDate], [CreationDate], [RevisionDate] ) @@ -69,6 +71,7 @@ BEGIN @GatewaySubscriptionId, @Enabled, @LicenseKey, + @ExpirationDate, @CreationDate, @RevisionDate ) diff --git a/src/Sql/dbo/Stored Procedures/Organization_Update.sql b/src/Sql/dbo/Stored Procedures/Organization_Update.sql index 14ad2c62ce..0a1f773e55 100644 --- a/src/Sql/dbo/Stored Procedures/Organization_Update.sql +++ b/src/Sql/dbo/Stored Procedures/Organization_Update.sql @@ -18,6 +18,7 @@ @GatewaySubscriptionId VARCHAR(50), @Enabled BIT, @LicenseKey VARCHAR(100), + @ExpirationDate DATETIME2(7), @CreationDate DATETIME2(7), @RevisionDate DATETIME2(7) @@ -46,6 +47,7 @@ BEGIN [GatewaySubscriptionId] = @GatewaySubscriptionId, [Enabled] = @Enabled, [LicenseKey] = @LicenseKey, + [ExpirationDate] = @ExpirationDate, [CreationDate] = @CreationDate, [RevisionDate] = @RevisionDate WHERE diff --git a/src/Sql/dbo/Stored Procedures/User_Create.sql b/src/Sql/dbo/Stored Procedures/User_Create.sql index ed334f9dd1..69f89322d5 100644 --- a/src/Sql/dbo/Stored Procedures/User_Create.sql +++ b/src/Sql/dbo/Stored Procedures/User_Create.sql @@ -16,6 +16,7 @@ @PublicKey NVARCHAR(MAX), @PrivateKey NVARCHAR(MAX), @Premium BIT, + @PremiumExpirationDate DATETIME2(7), @Storage BIGINT, @MaxStorageGb SMALLINT, @Gateway TINYINT, @@ -47,6 +48,7 @@ BEGIN [PublicKey], [PrivateKey], [Premium], + [PremiumExpirationDate], [Storage], [MaxStorageGb], [Gateway], @@ -75,6 +77,7 @@ BEGIN @PublicKey, @PrivateKey, @Premium, + @PremiumExpirationDate, @Storage, @MaxStorageGb, @Gateway, diff --git a/src/Sql/dbo/Stored Procedures/User_Update.sql b/src/Sql/dbo/Stored Procedures/User_Update.sql index 258b8c5af7..c820a99927 100644 --- a/src/Sql/dbo/Stored Procedures/User_Update.sql +++ b/src/Sql/dbo/Stored Procedures/User_Update.sql @@ -16,6 +16,7 @@ @PublicKey NVARCHAR(MAX), @PrivateKey NVARCHAR(MAX), @Premium BIT, + @PremiumExpirationDate DATETIME2(7), @Storage BIGINT, @MaxStorageGb SMALLINT, @Gateway TINYINT, @@ -47,6 +48,7 @@ BEGIN [PublicKey] = @PublicKey, [PrivateKey] = @PrivateKey, [Premium] = @Premium, + [PremiumExpirationDate] = @PremiumExpirationDate, [Storage] = @Storage, [MaxStorageGb] = @MaxStorageGb, [Gateway] = @Gateway, diff --git a/src/Sql/dbo/Tables/Organization.sql b/src/Sql/dbo/Tables/Organization.sql index 44258e20dc..30ee05147d 100644 --- a/src/Sql/dbo/Tables/Organization.sql +++ b/src/Sql/dbo/Tables/Organization.sql @@ -18,6 +18,7 @@ [GatewaySubscriptionId] VARCHAR (50) NULL, [Enabled] BIT NOT NULL, [LicenseKey] VARCHAR (100) NULL, + [ExpirationDate] DATETIME2 (7) NULL, [CreationDate] DATETIME2 (7) NOT NULL, [RevisionDate] DATETIME2 (7) NOT NULL, CONSTRAINT [PK_Organization] PRIMARY KEY CLUSTERED ([Id] ASC) diff --git a/src/Sql/dbo/Tables/User.sql b/src/Sql/dbo/Tables/User.sql index abc7e53be4..ff2fe03240 100644 --- a/src/Sql/dbo/Tables/User.sql +++ b/src/Sql/dbo/Tables/User.sql @@ -16,6 +16,7 @@ [PublicKey] VARCHAR (MAX) NULL, [PrivateKey] VARCHAR (MAX) NULL, [Premium] BIT NOT NULL, + [PremiumExpirationDate] DATETIME2 (7) NULL, [Storage] BIGINT NULL, [MaxStorageGb] SMALLINT NULL, [Gateway] TINYINT NULL,