diff --git a/server/biz/LicenseBiz.cs b/server/biz/LicenseBiz.cs index f150206..1c58e0f 100644 --- a/server/biz/LicenseBiz.cs +++ b/server/biz/LicenseBiz.cs @@ -49,7 +49,12 @@ namespace Sockeye.Biz else { if (!importedWithKeyDoNotGenerate)//do not generate is used for initial import only from rockfish, could be removed after the initial import + { await GenerateKey(newObject); + if(newObject.Active){//this means it should notify immediately + + } + } if (HasErrors) return null; newObject.Tags = TagBiz.NormalizeTags(newObject.Tags); await ct.License.AddAsync(newObject); @@ -671,6 +676,17 @@ namespace Sockeye.Biz return; } + //It's ready to go, MUST have an email address to send notification to + //for v8 keys even though there is no fetchemail required like v7 + //it is *still* used for notification and will be pre-filled with customer address if not provided so + //this is a backstop to ensure the notification message can be sent + //(revoked keys are *not* notified for obvious reasons so thats not a requirement here) + if (string.IsNullOrWhiteSpace(proposedObj.FetchEmail) && proposedObj.RegTo!=RavenKeyFactory.REVOKED_TOKEN) + { + AddError(ApiErrorCode.VALIDATION_REQUIRED, "FetchEmail"); + return; + } + if (proposedObj.Users < 1)//both require Users to be set { AddError(ApiErrorCode.VALIDATION_REQUIRED, "Users"); @@ -684,6 +700,8 @@ namespace Sockeye.Biz return; } + + //Active state rules for each product group switch (proposedObj.PGroup) diff --git a/server/models/License.cs b/server/models/License.cs index c6dfde8..caccd47 100644 --- a/server/models/License.cs +++ b/server/models/License.cs @@ -26,7 +26,7 @@ namespace Sockeye.Models public string RegTo { get; set; } public string Key { get; set; } public string FetchCode { get; set; }//v7 uses - public string FetchEmail { get; set; }//v7 uses + public string FetchEmail { get; set; }//v7 && v8 uses for notification, v7 uses for fetching manually in UI public DateTime? FetchedOn { get; set; } public string DbId { get; set; }//v8 uses diff --git a/todo.txt b/todo.txt index 8b1167b..9c19ec3 100644 --- a/todo.txt +++ b/todo.txt @@ -3,7 +3,6 @@ TODO: - JOB: notify user active license saved this should go out immediately on save once when state is changed from inactive to active can manually re-send by toggling active - NOTE: - JOB: Process purchases that are from vendor notification - create customer if necessary from purchase notification or add to existing - if v7 needs to account for there being a delay sometimes in order completeness