This commit is contained in:
2023-01-19 19:37:30 +00:00
parent dec62f0f56
commit 2996fdf47a
3 changed files with 19 additions and 2 deletions

View File

@@ -49,7 +49,12 @@ namespace Sockeye.Biz
else else
{ {
if (!importedWithKeyDoNotGenerate)//do not generate is used for initial import only from rockfish, could be removed after the initial import if (!importedWithKeyDoNotGenerate)//do not generate is used for initial import only from rockfish, could be removed after the initial import
{
await GenerateKey(newObject); await GenerateKey(newObject);
if(newObject.Active){//this means it should notify immediately
}
}
if (HasErrors) return null; if (HasErrors) return null;
newObject.Tags = TagBiz.NormalizeTags(newObject.Tags); newObject.Tags = TagBiz.NormalizeTags(newObject.Tags);
await ct.License.AddAsync(newObject); await ct.License.AddAsync(newObject);
@@ -671,6 +676,17 @@ namespace Sockeye.Biz
return; 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 if (proposedObj.Users < 1)//both require Users to be set
{ {
AddError(ApiErrorCode.VALIDATION_REQUIRED, "Users"); AddError(ApiErrorCode.VALIDATION_REQUIRED, "Users");
@@ -685,6 +701,8 @@ namespace Sockeye.Biz
} }
//Active state rules for each product group //Active state rules for each product group
switch (proposedObj.PGroup) switch (proposedObj.PGroup)
{ {

View File

@@ -26,7 +26,7 @@ namespace Sockeye.Models
public string RegTo { get; set; } public string RegTo { get; set; }
public string Key { get; set; } public string Key { get; set; }
public string FetchCode { get; set; }//v7 uses 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 DateTime? FetchedOn { get; set; }
public string DbId { get; set; }//v8 uses public string DbId { get; set; }//v8 uses

View File

@@ -3,7 +3,6 @@ TODO:
- JOB: notify user active license saved - JOB: notify user active license saved
this should go out immediately on save once when state is changed from inactive to active this should go out immediately on save once when state is changed from inactive to active
can manually re-send by toggling active can manually re-send by toggling active
NOTE:
- JOB: Process purchases that are from vendor notification - JOB: Process purchases that are from vendor notification
- create customer if necessary from purchase notification or add to existing - 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 - if v7 needs to account for there being a delay sometimes in order completeness