diff --git a/util/RavenKeyFactory.cs b/util/RavenKeyFactory.cs index 6d15382..a061921 100644 --- a/util/RavenKeyFactory.cs +++ b/util/RavenKeyFactory.cs @@ -31,8 +31,7 @@ namespace rockfishCore.Util // private const string QBOI_FEATURE_NAME = "QBOI"; //This feature name means it's a trial key private const string TRIAL_FEATURE_NAME = "TrialMode"; - //This feature name means it's a SAAS or rental mode key for month to month hosted service - private const string SUBSCRIPTION_FEATURE_NAME = "Subscription"; + #region license classes @@ -83,9 +82,10 @@ Plugins: sb.AppendLine("LICENSE DETAILS"); sb.AppendLine($"Registered to: {RegisteredTo}"); sb.AppendLine($"Database id: {DbId}"); + sb.AppendLine($"Type: {(Perpetual ? "Perpetual" : "Subscription")}"); if (WillExpire) sb.AppendLine($"License valid until: {LicenseExpiration.ToLongDateString()}"); - sb.AppendLine($"Support and updates until: {MaintenanceExpiration.ToLongDateString()}"); + sb.AppendLine($"Maintenance until: {MaintenanceExpiration.ToLongDateString()}"); foreach (LicenseFeature f in Features) { if (f.Feature == TRIAL_FEATURE_NAME) @@ -93,11 +93,7 @@ Plugins: sb.AppendLine("Temporary license for evaluation"); continue; } - if (f.Feature == SUBSCRIPTION_FEATURE_NAME) - { - sb.AppendLine("Subscription license"); - continue; - } + // if (f.Feature == QBI_FEATURE_NAME) // { // sb.AppendLine("QuickBooks desktop integration option"); @@ -212,18 +208,13 @@ Plugins: } } - public bool RentalLicense - { - get - { - return HasLicenseFeature(SUBSCRIPTION_FEATURE_NAME); - } - } + public string LicenseFormat { get; set; } public string Id { get; set; } public string RegisteredTo { get; set; } public string DbId { get; set; } + public bool Perpetual { get; set; } public DateTime LicenseExpiration { get; set; } public DateTime MaintenanceExpiration { get; set; } public List Features { get; set; } @@ -482,7 +473,7 @@ oArP0E2Vbow3JMxq/oeXmHbrLMLQfYyXwFmciLFigOtkd45bfHdrbA== k.Features.Add(new LicenseFeature() { Feature = SERVICE_TECHS_FEATURE_NAME, Count = 100 }); k.MaintenanceExpiration = k.LicenseExpiration = DateTime.UtcNow.AddMonths(1); k.Features.Add(new LicenseFeature() { Feature = TRIAL_FEATURE_NAME, Count = 0 }); - // k.Features.Add(new LicenseFeature() { Feature = SUBSCRIPTION_FEATURE_NAME, Count = 0 }); + // k.Features.Add(new LicenseFeature() { Feature = SUBSCRIPTION_FEATURE_NAME, Count = 0 }); return GenerateRavenKey(k); } diff --git a/util/RfSchema.cs b/util/RfSchema.cs index aeb0529..292a3f4 100644 --- a/util/RfSchema.cs +++ b/util/RfSchema.cs @@ -13,7 +13,7 @@ namespace rockfishCore.Util ///////////////////////////////////////////////////////////////// /////////// CHANGE THIS ON NEW SCHEMA UPDATE //////////////////// - public const int DESIRED_SCHEMA_LEVEL = 16; + public const int DESIRED_SCHEMA_LEVEL = 17; ///////////////////////////////////////////////////////////////// @@ -385,6 +385,37 @@ namespace rockfishCore.Util currentSchema = 16; setSchemaLevel(currentSchema); } + + ////////////////////////////////////////////////// + //schema 17 RAVEN Subscription license stuff + if (currentSchema < 17) + { + + exec("alter table trialrequest add perpetual boolean default 0 NOT NULL CHECK (perpetual IN (0,1))"); + //get rid of test products (which I never used anyway) + exec("delete from product where productCode like 'testfeat%'"); + + exec("insert into product (name, productCode, price, renewPrice) values ('Single AyaNova service techncian perpetual license','301028314',135, 100);"); + exec("insert into product (name, productCode, price, renewPrice) values ('Single AyaNova service techncian 1 year maintenance plan - new','301028317',135, 100);"); + exec("insert into product (name, productCode, price, renewPrice) values ('Single AyaNova service techncian 1 year maintenance plan - active','301028315',100, 100);"); + + + + exec("alter table site add dbid text default 'v7_no_dbid' NOT NULL"); + exec("update site set legacyv7 = 1"); + exec("alter table license add dbid text default 'v7_no_dbid' NOT NULL"); + exec("alter table license add siteid integer"); + exec("alter table license add dtLicenseExpiration integer"); + exec("alter table license add dtMaintenanceExpiration integer"); + exec("alter table purchase add quantity integer default 1 not null"); + exec("insert into product (name, productCode, price, renewPrice) values ('TEST RAVEN schedulable resource 1 year subscription license','testfeatscheduser',15900, 5565);"); + exec("insert into product (name, productCode, price, renewPrice) values ('TEST RAVEN Accounting 1 year subscription license','testfeatacct',15000, 5250);"); + exec("insert into product (name, productCode, price, renewPrice) values ('TEST RAVEN Feature Trial mode','testfeattrial',0, 0);"); + exec("insert into product (name, productCode, price, renewPrice) values ('TEST RAVEN Feature Service mode','testfeatservice',0, 0);"); + + currentSchema = 17; + setSchemaLevel(currentSchema); + } //*************************************************************************************