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
{
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)

View File

@@ -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

View File

@@ -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