diff --git a/Controllers/TrialController.cs b/Controllers/TrialController.cs index 0ab904f..9ffe1d6 100644 --- a/Controllers/TrialController.cs +++ b/Controllers/TrialController.cs @@ -83,7 +83,7 @@ namespace rockfishCore.Controllers } //generate license key and insert in record - trial.Key = RavenKeyFactory.GetRavenTrialKey(trial.DbId, trial.CompanyName); + trial.Key = RavenKeyFactory.GetRavenTrialKey(trial.DbId, trial.CompanyName, trial.Perpetual); trial.Status = TrialRequest.TrialRequestStatus.Approved; trial.DtProcessed = DateUtil.NowAsEpoch(); await ct.SaveChangesAsync(); diff --git a/Models/TrialRequest.cs b/Models/TrialRequest.cs index de1a1e5..5e0b415 100644 --- a/Models/TrialRequest.cs +++ b/Models/TrialRequest.cs @@ -31,6 +31,7 @@ namespace rockfishCore.Models } public long Id { get; set; } public string DbId { get; set; } + public bool Perpetual { get; set; } public string CompanyName { get; set; } public string ContactName { get; set; } public string Notes { get; set; } diff --git a/util/RavenKeyFactory.cs b/util/RavenKeyFactory.cs index a061921..9df3fb0 100644 --- a/util/RavenKeyFactory.cs +++ b/util/RavenKeyFactory.cs @@ -263,7 +263,7 @@ Plugins: - public static string GetRavenTrialKey(string dbid, string CompanyName) + public static string GetRavenTrialKey(string dbid, string CompanyName, bool Perpetual) { //Build a sample test key, sign it and return it @@ -277,14 +277,14 @@ Plugins: // k.Id = $"00-{sId}"; k.RegisteredTo = CompanyName; k.DbId = dbid; + k.Perpetual=Perpetual; //trial period time limit k.MaintenanceExpiration = k.LicenseExpiration = DateTime.UtcNow.AddDays(TRIAL_PERIOD_DAYS); //flag as trial key not regular key k.Features.Add(new LicenseFeature() { Feature = TRIAL_FEATURE_NAME, Count = 0 }); - //flag it as a temporary expiring key so that the expiration date takes effect - k.Features.Add(new LicenseFeature() { Feature = SUBSCRIPTION_FEATURE_NAME, Count = 0 }); + //add every possible feature //k.Features.Add(new LicenseFeature() { Feature = QBI_FEATURE_NAME, Count = 0 }); diff --git a/util/RfSchema.cs b/util/RfSchema.cs index 292a3f4..92cde72 100644 --- a/util/RfSchema.cs +++ b/util/RfSchema.cs @@ -399,20 +399,6 @@ namespace rockfishCore.Util 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); }