This commit is contained in:
2023-02-16 01:25:20 +00:00
parent 8fba668d52
commit 6f0455aa85
5 changed files with 46 additions and 7 deletions

2
.vscode/launch.json vendored
View File

@@ -33,7 +33,7 @@
"SOCKEYE_DB_CONNECTION": "Server=localhost;Username=postgres;Password=sockeye;Database=sockeye;CommandTimeout=300;",
"SOCKEYE_DATA_PATH": "c:\\temp\\sockeye",
"SOCKEYE_USE_URLS": "http://*:7676;",
//"SOCKEYE_PERMANENTLY_ERASE_DATABASE": "true",
"SOCKEYE_PERMANENTLY_ERASE_DATABASE": "true",
//"SOCKEYE_REPORT_RENDERING_TIMEOUT":"1",
"SOCKEYE_BACKUP_PG_DUMP_PATH": "C:\\data\\code\\postgres_14\\bin"
},

View File

@@ -59,7 +59,9 @@ namespace Sockeye.Api.Controllers
//Get the most recent key for this dbid regardless if fetched or not, most recent is most recent and supersedes any other keys
//for the same database id
//this means if a user requests a trial key then buys a key but both are unfetched the bought key takes precedence or vice versa
var license = await ct.License.OrderByDescending(z => z.Id).Where(z => z.DbId == FetchRequestDbId).FirstOrDefaultAsync();
var license = await ct.License.OrderByDescending(z => z.Id)
.Where(z => z.DbId == FetchRequestDbId && z.Active == true)
.FirstOrDefaultAsync();
if (license != null)
{
//Found a recent purchased key, if not fetched then can be sent

View File

@@ -199,7 +199,7 @@ namespace Sockeye.Biz
if (multiSite)
{
CustomerName += " - " + jSite["name"].Value<string>();
CustomerName = $"{jCustomer["name"].Value<string>()} - {jSite["name"].Value<string>()}";
log.LogInformation($"RFImport MULTISITE CUSTOMER: {CustomerName}");
}
@@ -786,7 +786,42 @@ namespace Sockeye.Biz
tlr.EmailValidated = jTrialRequestItem["emailValidated"].Value<bool>();
tlr.Requested = (DateTime)DateUtil.EpochToDateNullIsNull(jTrialRequestItem["dtRequested"].Value<long>());
tlr.Processed = DateUtil.EpochToDateNullIsNull(jTrialRequestItem["dtProcessed"].Value<long?>());
tlr.Status = (TrialRequestStatus)jTrialRequestItem["status"].Value<int>();
/*
rockfish status differs numerically
switch (obj.status) {
case 0:
return "NEW";
case 1:
return "approved";
case 2:
return "rejected";
default:
return "BAD STATUS: " + obj.status;
}
sockeye:
New = 0,
AwaitingEmailValidation = 1,
AwaitingApproval = 2,
Approved = 3,
Rejected = 4
*/
switch (jTrialRequestItem["status"].Value<int>())
{
case 0:
tlr.Status = TrialRequestStatus.New;
break;
case 1:
tlr.Status = TrialRequestStatus.Approved;
break;
case 2:
tlr.Status = TrialRequestStatus.Rejected;
break;
default:
tlr.Status = TrialRequestStatus.Rejected;//just set unknowns to rejected
break;
}
tlr.RejectReason = jTrialRequestItem["rejectReason"].Value<string>();
tlr.LicenseId = TrialKeyId;
var biz = TrialLicenseRequestBiz.GetBiz(ct);

View File

@@ -55,7 +55,7 @@ namespace Sockeye.Biz
else
{
if (!importedWithKeyDoNotGenerate)//do not generate is used for initial import only from rockfish, could be removed after the initial import
if (!importedWithKeyDoNotGenerate && newObject.Active)//do not generate is used for initial import only from rockfish, could be removed after the initial import
{
await GenerateKey(newObject);
@@ -120,7 +120,9 @@ namespace Sockeye.Biz
}
await ValidateAsync(putObject, dbObject);
if (HasErrors) return null;
await GenerateKey(putObject);
if(putObject.Active)
await GenerateKey(putObject);
if (HasErrors) return null;
ct.Replace(dbObject, putObject);

View File

@@ -27,7 +27,7 @@ namespace Sockeye.Models
ConnectionSecurity = NotifyMailSecurity.SSLTLS;
SmtpServerPort = 465;
NotifyFromAddress = "support@ayanova.com";
SockeyeServerURL = "http://localhost:8080";
SockeyeServerURL = "https://rockfish.ayanova.com";
}