This commit is contained in:
2023-01-13 01:09:05 +00:00
parent 5ba5b65a5d
commit 650ae96987
22 changed files with 268 additions and 42 deletions

View File

@@ -19,7 +19,8 @@ namespace Sockeye.Api.ControllerHelpers
UNKNOWN = 0,
///<summary>No access for anyone API completely locked down. Not set by user but rather by internal server operations like importing or backup.</summary>
Closed = 1,
///<summary>Access only to SuperUser account for migration from Rockfish</summary>
MigrateMode = 2,
///<summary>Access only to API Operations routes. Can be set by Ops user</summary>
OpsOnly = 3,
///<summary>Open for all users (default). Can be set by Ops user</summary>
@@ -128,7 +129,7 @@ namespace Sockeye.Api.ControllerHelpers
throw new System.NotSupportedException("ApiServerState:ApiErrorCode - No error code is associated with server state OPEN");
case ServerState.OpsOnly:
return ApiErrorCode.API_OPS_ONLY;
case ServerState.Closed:
return ApiErrorCode.API_CLOSED;
@@ -177,7 +178,7 @@ namespace Sockeye.Api.ControllerHelpers
}
}
public bool IsOpen
{
get

View File

@@ -556,10 +556,14 @@ namespace Sockeye.Api.Controllers
else if (keyNameInLowerCase == StringUtil.TrimTypeName(typeof(TrialRequestStatus).ToString()).ToLowerInvariant())
{
TranslationKeysToFetch.Add("TrialRequestStatusNew");
TranslationKeysToFetch.Add("TrialRequestStatusAwaitingEmailValidation");
TranslationKeysToFetch.Add("TrialRequestStatusAwaitingApproval");
TranslationKeysToFetch.Add("TrialRequestStatusApproved");
TranslationKeysToFetch.Add("TrialRequestStatusRejected");
var LT = await TranslationBiz.GetSubsetStaticAsync(TranslationKeysToFetch, translationId);
ReturnList.Add(new NameIdItem() { Name = LT["TrialRequestStatusNew"], Id = (long)TrialRequestStatus.New });
ReturnList.Add(new NameIdItem() { Name = LT["TrialRequestStatusAwaitingEmailValidation"], Id = (long)TrialRequestStatus.AwaitingEmailValidation });
ReturnList.Add(new NameIdItem() { Name = LT["TrialRequestStatusAwaitingApproval"], Id = (long)TrialRequestStatus.AwaitingApproval });
ReturnList.Add(new NameIdItem() { Name = LT["TrialRequestStatusApproved"], Id = (long)TrialRequestStatus.Approved });
ReturnList.Add(new NameIdItem() { Name = LT["TrialRequestStatusRejected"], Id = (long)TrialRequestStatus.Rejected });
}

View File

@@ -633,6 +633,7 @@ namespace Sockeye.Biz
//
public async Task HandlePotentialNotificationEvent(SockEvent ayaEvent, ICoreBizObjectModel proposedObj, ICoreBizObjectModel currentObj = null)
{
if (ServerBootConfig.MIGRATING) return;
ILogger log = Sockeye.Util.ApplicationLogging.CreateLogger<CustomerBiz>();
log.LogDebug($"HandlePotentialNotificationEvent processing: [SockType:{this.BizType}, AyaEvent:{ayaEvent}]");

View File

@@ -270,6 +270,7 @@ namespace Sockeye.Biz
public async Task HandlePotentialNotificationEvent(SockEvent ayaEvent, ICoreBizObjectModel proposedObj, ICoreBizObjectModel currentObj = null)
{
if (ServerBootConfig.MIGRATING) return;
ILogger log = Sockeye.Util.ApplicationLogging.CreateLogger<CustomerNoteBiz>();
log.LogDebug($"HandlePotentialNotificationEvent processing: [SockType:{this.BizType}, AyaEvent:{ayaEvent}]");

View File

@@ -412,6 +412,7 @@ namespace Sockeye.Biz
//
public async Task HandlePotentialNotificationEvent(SockEvent ayaEvent, ICoreBizObjectModel proposedObj, ICoreBizObjectModel currentObj = null)
{
if (ServerBootConfig.MIGRATING) return;
ILogger log = Sockeye.Util.ApplicationLogging.CreateLogger<GZCaseBiz>();
log.LogDebug($"HandlePotentialNotificationEvent processing: [SockType:{this.BizType}, AyaEvent:{ayaEvent}]");

View File

@@ -132,6 +132,14 @@ namespace Sockeye.Biz
public async Task ImportRockfish(AyContext ct, ILogger log)
{
log.LogInformation("Start import from rockfish, authenticating");
ApiServerState apiServerState = (ApiServerState)ServiceProviderProvider.Provider.GetService(typeof(ApiServerState));
//get the current server state so can set back to it later
ApiServerState.ServerState wasServerState = apiServerState.GetState();
string wasReason = apiServerState.Reason;
apiServerState.SetOpsOnly("Migrating from Rockfish");
ServerBootConfig.MIGRATING = true;
//Authenticate to rockfish
//string sUrl = $"{LICENSE_SERVER_URL_ROCKFISH}rvr";
string URL_ROCKFISH = "https://rockfish.ayanova.com/";
@@ -766,6 +774,12 @@ namespace Sockeye.Biz
var msg = "*** RockFish import FAILED ***";
log.LogError(ex, msg);
}
finally
{
ServerBootConfig.MIGRATING = false;
log.LogInformation($"Migrate Rockfish: setting server state back to {wasServerState.ToString()}");
apiServerState.SetState(wasServerState, wasReason);
}

View File

@@ -553,6 +553,7 @@ namespace Sockeye.Biz
//
public async Task HandlePotentialNotificationEvent(SockEvent ayaEvent, ICoreBizObjectModel proposedObj, ICoreBizObjectModel currentObj = null)
{
if (ServerBootConfig.MIGRATING) return;
ILogger log = Sockeye.Util.ApplicationLogging.CreateLogger<HeadOfficeBiz>();
log.LogDebug($"HandlePotentialNotificationEvent processing: [SockType:{this.BizType}, AyaEvent:{ayaEvent}]");

View File

@@ -432,10 +432,10 @@ namespace Sockeye.Biz
string keyNoWS = System.Text.RegularExpressions.Regex.Replace(StringUtil.Extract(l.Key, "[KEY", "KEY]").Trim(), "(\"(?:[^\"\\\\]|\\\\.)*\")|\\s+", "$1");
var jKey = JObject.Parse(keyNoWS);
// #if (DEBUG)
// if (jKey["Key"]["DBID"].Value<string>() == "mRntGkdwvYCDOAOroCQpB5Elbct09iNIS7lcU7QgRCY=")
// System.Diagnostics.Debugger.Break();
// #endif
// #if (DEBUG)
// if (jKey["Key"]["DBID"].Value<string>() == "mRntGkdwvYCDOAOroCQpB5Elbct09iNIS7lcU7QgRCY=")
// System.Diagnostics.Debugger.Break();
// #endif
var jaFeatures = (JArray)jKey.SelectToken("Key.Features");
@@ -972,6 +972,7 @@ namespace Sockeye.Biz
//
public async Task HandlePotentialNotificationEvent(SockEvent ayaEvent, ICoreBizObjectModel proposedObj, ICoreBizObjectModel currentObj = null)
{
if (ServerBootConfig.MIGRATING) return;
ILogger log = Sockeye.Util.ApplicationLogging.CreateLogger<LicenseBiz>();
log.LogDebug($"HandlePotentialNotificationEvent processing: [SockType:{this.BizType}, AyaEvent:{ayaEvent}]");
@@ -997,8 +998,7 @@ namespace Sockeye.Biz
if (ayaEvent == SockEvent.Created || ayaEvent == SockEvent.Modified)
{
}
}//end of process notifications

View File

@@ -485,6 +485,7 @@ namespace Sockeye.Biz
//
public async Task HandlePotentialNotificationEvent(SockEvent ayaEvent, ICoreBizObjectModel proposedObj, ICoreBizObjectModel currentObj = null)
{
if (ServerBootConfig.MIGRATING) return;
ILogger log = Sockeye.Util.ApplicationLogging.CreateLogger<MemoBiz>();
log.LogDebug($"HandlePotentialNotificationEvent processing: [SockType:{this.BizType}, AyaEvent:{ayaEvent}]");

View File

@@ -404,6 +404,7 @@ namespace Sockeye.Biz
//
public async Task HandlePotentialNotificationEvent(SockEvent ayaEvent, ICoreBizObjectModel proposedObj, ICoreBizObjectModel currentObj = null)
{
if (ServerBootConfig.MIGRATING) return;
ILogger log = Sockeye.Util.ApplicationLogging.CreateLogger<ProductBiz>();
log.LogDebug($"HandlePotentialNotificationEvent processing: [SockType:{this.BizType}, AyaEvent:{ayaEvent}]");

View File

@@ -427,6 +427,7 @@ namespace Sockeye.Biz
//
public async Task HandlePotentialNotificationEvent(SockEvent ayaEvent, ICoreBizObjectModel proposedObj, ICoreBizObjectModel currentObj = null)
{
if (ServerBootConfig.MIGRATING) return;
ILogger log = Sockeye.Util.ApplicationLogging.CreateLogger<PurchaseBiz>();
log.LogDebug($"HandlePotentialNotificationEvent processing: [SockType:{this.BizType}, AyaEvent:{ayaEvent}]");
@@ -452,7 +453,35 @@ namespace Sockeye.Biz
if (ayaEvent == SockEvent.Created || ayaEvent == SockEvent.Modified)
{
//# NEW PURCHASE VENDOR NOTIFICATION
if (ayaEvent == SockEvent.Created && (!string.IsNullOrWhiteSpace(o.VendorData)))
{
//Get product name and get customer name to notify
var productName = await ct.Product.AsNoTracking().Where(x => x.Id == o.ProductId).Select(x => x.Name).FirstOrDefaultAsync();
var customerName = await ct.Customer.AsNoTracking().Where(x => x.Id == o.CustomerId).Select(x => x.Name).FirstOrDefaultAsync();
{
//Newly created only and immediate delivery so no need to remove
var subs = await ct.NotifySubscription.AsNoTracking().Where(z => z.EventType == NotifyEventType.PurchaseNotificationReceived).ToListAsync();
foreach (var sub in subs)
{
//not for inactive users
if (!await UserBiz.UserIsActive(sub.UserId)) continue;
NotifyEvent n = new NotifyEvent()
{
EventType = NotifyEventType.PurchaseNotificationReceived,
UserId = sub.UserId,
SockType = BizType,
ObjectId = o.Id,
NotifySubscriptionId = sub.Id,
Name = $"Purchase - {customerName}, {productName} x {o.Quantity} "
};
await ct.NotifyEvent.AddAsync(n);
log.LogDebug($"Adding NotifyEvent: [{n.ToString()}]");
await ct.SaveChangesAsync();
}
}
}//new purchase notification event
}

View File

@@ -475,6 +475,7 @@ namespace Sockeye.Biz
//
public async Task HandlePotentialNotificationEvent(SockEvent ayaEvent, ICoreBizObjectModel proposedObj, ICoreBizObjectModel currentObj = null)
{
if (ServerBootConfig.MIGRATING) return;
ILogger log = Sockeye.Util.ApplicationLogging.CreateLogger<ReminderBiz>();
log.LogDebug($"HandlePotentialNotificationEvent processing: [SockType:{this.BizType}, AyaEvent:{ayaEvent}]");

View File

@@ -549,6 +549,7 @@ namespace Sockeye.Biz
//
public async Task HandlePotentialNotificationEvent(SockEvent ayaEvent, ICoreBizObjectModel proposedObj, ICoreBizObjectModel currentObj = null)
{
if (ServerBootConfig.MIGRATING) return;
ILogger log = Sockeye.Util.ApplicationLogging.CreateLogger<ReviewBiz>();
log.LogDebug($"HandlePotentialNotificationEvent processing: [SockType:{this.BizType}, AyaEvent:{ayaEvent}]");

View File

@@ -410,6 +410,7 @@ namespace Sockeye.Biz
//
public async Task HandlePotentialNotificationEvent(SockEvent ayaEvent, ICoreBizObjectModel proposedObj, ICoreBizObjectModel currentObj = null)
{
if (ServerBootConfig.MIGRATING) return;
ILogger log = Sockeye.Util.ApplicationLogging.CreateLogger<SubscriptionServerBiz>();
log.LogDebug($"HandlePotentialNotificationEvent processing: [SockType:{this.BizType}, AyaEvent:{ayaEvent}]");
@@ -435,6 +436,39 @@ namespace Sockeye.Biz
if (ayaEvent == SockEvent.Created || ayaEvent == SockEvent.Modified)
{
//# NEW TRIAL SERVER REQUEST
if (ayaEvent == SockEvent.Created && o.Trial == true)
{
{
//Conditions: must match specific status id value and also tags below
//Newly created only and immediate delivery so no need to remove
var subs = await ct.NotifySubscription.AsNoTracking().Where(z => z.EventType == NotifyEventType.SubscriptionServerRequestReceived).ToListAsync();
foreach (var sub in subs)
{
//not for inactive users
if (!await UserBiz.UserIsActive(sub.UserId)) continue;
//Tag match? (will be true if no sub tags so always safe to call this)
if (NotifyEventHelper.ObjectHasAllSubscriptionTags(o.Tags, sub.Tags))
{
NotifyEvent n = new NotifyEvent()
{
EventType = NotifyEventType.SubscriptionServerRequestReceived,
UserId = sub.UserId,
SockType = BizType,
ObjectId = o.Id,
NotifySubscriptionId = sub.Id,
Name = $"{o.TrialCompany} - trial server requested"
};
await ct.NotifyEvent.AddAsync(n);
log.LogDebug($"Adding NotifyEvent: [{n.ToString()}]");
await ct.SaveChangesAsync();
}
}
}
}//new trial server request event
//# SUBSCRIPTION SERVER EXPIRY
{
//notify users about warranty expiry (time delayed)
@@ -498,7 +532,7 @@ namespace Sockeye.Biz
}
}
}//subscription server expiry event
}//subscription server last updated event

View File

@@ -270,7 +270,7 @@ namespace Sockeye.Biz
private VizCache vc = new VizCache();
////////////////////////////////////////////////////////////////////////////////////////////////
// IMPORT EXPORT
@@ -405,6 +405,7 @@ namespace Sockeye.Biz
//
public async Task HandlePotentialNotificationEvent(SockEvent ayaEvent, ICoreBizObjectModel proposedObj, ICoreBizObjectModel currentObj = null)
{
if (ServerBootConfig.MIGRATING) return;
ILogger log = Sockeye.Util.ApplicationLogging.CreateLogger<TrialLicenseRequestBiz>();
log.LogDebug($"HandlePotentialNotificationEvent processing: [SockType:{this.BizType}, AyaEvent:{ayaEvent}]");
@@ -418,21 +419,135 @@ namespace Sockeye.Biz
//SPECIFIC EVENTS FOR THIS OBJECT
TrialLicenseRequest o = (TrialLicenseRequest)proposedObj;
//## DELETED EVENTS
//any event added below needs to be removed, so
//just blanket remove any event for this object of eventtype that would be added below here
//do it regardless any time there's an update and then
//let this code below handle the refreshing addition that could have changes
//await NotifyEventHelper.ClearPriorEventsForObject(ct, SockType.TrialLicenseRequest, o.Id, NotifyEventType.ContractExpiring);
//## CREATED / MODIFIED EVENTS
if (ayaEvent == SockEvent.Created || ayaEvent == SockEvent.Modified)
//# TRIAL KEY REQUEST EMAIL CONFIRMED - NOTIFY US IS READY FOR PROCESSING
if (ayaEvent == SockEvent.Modified && o.EmailValidated && o.Status == TrialRequestStatus.AwaitingApproval && o.Processed == null)
{
{
//Newly created only and immediate delivery so no need to remove
var subs = await ct.NotifySubscription.AsNoTracking().Where(z => z.EventType == NotifyEventType.LicenseTrialRequestReceived).ToListAsync();
foreach (var sub in subs)
{
//not for inactive users
if (!await UserBiz.UserIsActive(sub.UserId)) continue;
NotifyEvent n = new NotifyEvent()
{
EventType = NotifyEventType.LicenseTrialRequestReceived,
UserId = sub.UserId,
SockType = BizType,
ObjectId = o.Id,
NotifySubscriptionId = sub.Id,
Name = $"{o.CompanyName} - trial license requested"
};
await ct.NotifyEvent.AddAsync(n);
log.LogDebug($"Adding NotifyEvent: [{n.ToString()}]");
await ct.SaveChangesAsync();
}
}
}//new trial key request event
}
//## ------------------ DEFAULT NOTIFICATIONS ----------------
//ValidateEmail request message,RavenTrialApproved (which sends pending manual generation message) and RavenTrialRejected messages are sent in this block
//
//
var custInfo = await ct.Customer.AsNoTracking().Where(x => x.Id == o.CustomerId).Select(x => new { x.Active, x.Tags, x.EmailAddress }).FirstOrDefaultAsync();
if (custInfo != null && custInfo.Active && !string.IsNullOrWhiteSpace(custInfo.EmailAddress))//can this customer receive *any* customer notifications?
{
//-------- Customer is notifiable ------
// //# STATUS CHANGE (create new status)
// {
// //Conditions: must match specific status id value and also tags below
// //delivery is immediate so no need to remove old ones of this kind
// var subs = await ct.CustomerNotifySubscription.AsNoTracking().Where(z => z.EventType == NotifyEventType.WorkorderStatusChange && z.IdValue == oProposed.WorkOrderStatusId).OrderBy(z => z.Id).ToListAsync();
// foreach (var sub in subs)
// {
// //Object tags must match and Customer tags must match
// if (NotifyEventHelper.ObjectHasAllSubscriptionTags(WorkorderInfo.Tags, sub.Tags) && NotifyEventHelper.ObjectHasAllSubscriptionTags(custInfo.Tags, sub.CustomerTags))
// {
// CustomerNotifyEvent n = new CustomerNotifyEvent()
// {
// EventType = NotifyEventType.WorkorderStatusChange,
// CustomerId = WorkorderInfo.CustomerId,
// AyaType = AyaType.WorkOrder,
// ObjectId = oProposed.WorkOrderId,
// CustomerNotifySubscriptionId = sub.Id,
// Name = WorkorderInfo.Serial.ToString()
// };
// await ct.CustomerNotifyEvent.AddAsync(n);
// log.LogDebug($"Adding CustomerNotifyEvent: [{n.ToString()}]");
// await ct.SaveChangesAsync();
// break;//we have a match no need to process any further subs for this event
// }
// }
// }//workorder status change event
// //# STATUS AGE
// {
// //WorkorderStatusAge = 24,//* Workorder STATUS unchanged for set time (stuck in state), conditional on: Duration (how long stuck), exact status selected IdValue, Tags. Advance notice can NOT be set
// //Always clear any old ones for this object as they are all irrelevant the moment the state has changed:
// await NotifyEventHelper.ClearPriorCustomerNotifyEventsForObject(ct, proposedObj.AyaType, proposedObj.Id, NotifyEventType.WorkorderStatusAge);
// var subs = await ct.CustomerNotifySubscription.AsNoTracking().Where(z => z.EventType == NotifyEventType.WorkorderStatusAge && z.IdValue == oProposed.WorkOrderStatusId).OrderBy(z => z.Id).ToListAsync();
// foreach (var sub in subs)
// {
// //Object tags must match and Customer tags must match
// if (NotifyEventHelper.ObjectHasAllSubscriptionTags(WorkorderInfo.Tags, sub.Tags) && NotifyEventHelper.ObjectHasAllSubscriptionTags(custInfo.Tags, sub.CustomerTags))
// {
// CustomerNotifyEvent n = new CustomerNotifyEvent()
// {
// EventType = NotifyEventType.WorkorderStatusAge,
// CustomerId = WorkorderInfo.CustomerId,
// AyaType = AyaType.WorkOrder,
// ObjectId = oProposed.WorkOrderId,
// CustomerNotifySubscriptionId = sub.Id,
// Name = WorkorderInfo.Serial.ToString()
// };
// await ct.CustomerNotifyEvent.AddAsync(n);
// log.LogDebug($"Adding CustomerNotifyEvent: [{n.ToString()}]");
// await ct.SaveChangesAsync();
// break;//we have a match no need to process any further subs for this event
// }
// }
// }//workorder status age event
// //# WorkorderCompleted
// {
// if (wos.Completed)
// {
// var subs = await ct.CustomerNotifySubscription.AsNoTracking().Where(z => z.EventType == NotifyEventType.WorkorderCompleted).OrderBy(z => z.Id).ToListAsync();
// foreach (var sub in subs)
// {
// //Object tags must match and Customer tags must match
// if (NotifyEventHelper.ObjectHasAllSubscriptionTags(WorkorderInfo.Tags, sub.Tags) && NotifyEventHelper.ObjectHasAllSubscriptionTags(custInfo.Tags, sub.CustomerTags))
// {
// CustomerNotifyEvent n = new CustomerNotifyEvent()
// {
// EventType = NotifyEventType.WorkorderCompleted,
// CustomerId = WorkorderInfo.CustomerId,
// AyaType = AyaType.WorkOrder,
// ObjectId = oProposed.WorkOrderId,
// CustomerNotifySubscriptionId = sub.Id,
// Name = WorkorderInfo.Serial.ToString()
// };
// await ct.CustomerNotifyEvent.AddAsync(n);
// log.LogDebug($"Adding CustomerNotifyEvent: [{n.ToString()}]");
// await ct.SaveChangesAsync();
// break;//we have a match no need to process any further subs for this event
// }
// }
// }
// }//WorkorderCompleted
//-----------------------
} //------------------ /default notifications ---------------
}//end of process notifications

View File

@@ -3,8 +3,10 @@ namespace Sockeye.Biz
public enum TrialRequestStatus
{
New = 0,
Approved = 1,
Rejected = 2
AwaitingEmailValidation = 1,
AwaitingApproval = 2,
Approved = 3,
Rejected = 4
}
}//eons

View File

@@ -954,6 +954,7 @@ namespace Sockeye.Biz
//
public async Task HandlePotentialNotificationEvent(SockEvent ayaEvent, ICoreBizObjectModel proposedObj, ICoreBizObjectModel currentObj = null)
{
if (ServerBootConfig.MIGRATING) return;
ILogger log = Sockeye.Util.ApplicationLogging.CreateLogger<UserBiz>();
log.LogDebug($"HandlePotentialNotificationEvent processing: [SockType:{this.BizType}, AyaEvent:{ayaEvent}]");

View File

@@ -538,6 +538,7 @@ namespace Sockeye.Biz
//
public async Task HandlePotentialNotificationEvent(SockEvent SockEvent, ICoreBizObjectModel proposedObj, ICoreBizObjectModel currentObj = null)
{
if (ServerBootConfig.MIGRATING) return;
ILogger log = Sockeye.Util.ApplicationLogging.CreateLogger<VendorBiz>();
log.LogDebug($"HandlePotentialNotificationEvent processing: [SockType:{this.BizType}, SockEvent:{SockEvent}]");

View File

@@ -980,6 +980,8 @@ $BODY$ LANGUAGE PLPGSQL STABLE");
await ExecQueryAsync("INSERT INTO atranslationitem(translationid,key,display) SELECT t.id, 'TrialRequestStatusNew', 'New' FROM atranslation t where t.baselanguage = 'en'");
await ExecQueryAsync("INSERT INTO atranslationitem(translationid,key,display) SELECT t.id, 'TrialRequestStatusApproved', 'Approved' FROM atranslation t where t.baselanguage = 'en'");
await ExecQueryAsync("INSERT INTO atranslationitem(translationid,key,display) SELECT t.id, 'TrialRequestStatusRejected', 'Rejected' FROM atranslation t where t.baselanguage = 'en'");
await ExecQueryAsync("INSERT INTO atranslationitem(translationid,key,display) SELECT t.id, 'TrialRequestStatusAwaitingEmailValidation', 'Awaiting email validation' FROM atranslation t where t.baselanguage = 'en'");
await ExecQueryAsync("INSERT INTO atranslationitem(translationid,key,display) SELECT t.id, 'TrialRequestStatusAwaitingApproval', 'Awaiting approval' FROM atranslation t where t.baselanguage = 'en'");
//spanish translations
await ExecQueryAsync("INSERT INTO atranslationitem(translationid,key,display) SELECT t.id, 'TrialLicenseRequest', 'Trial license request' FROM atranslation t where t.baselanguage = 'es'");
@@ -995,6 +997,8 @@ $BODY$ LANGUAGE PLPGSQL STABLE");
await ExecQueryAsync("INSERT INTO atranslationitem(translationid,key,display) SELECT t.id, 'TrialRequestStatusNew', 'New' FROM atranslation t where t.baselanguage = 'es'");
await ExecQueryAsync("INSERT INTO atranslationitem(translationid,key,display) SELECT t.id, 'TrialRequestStatusApproved', 'Approved' FROM atranslation t where t.baselanguage = 'es'");
await ExecQueryAsync("INSERT INTO atranslationitem(translationid,key,display) SELECT t.id, 'TrialRequestStatusRejected', 'Rejected' FROM atranslation t where t.baselanguage = 'es'");
await ExecQueryAsync("INSERT INTO atranslationitem(translationid,key,display) SELECT t.id, 'TrialRequestStatusAwaitingEmailValidation', 'Awaiting email validation' FROM atranslation t where t.baselanguage = 'es'");
await ExecQueryAsync("INSERT INTO atranslationitem(translationid,key,display) SELECT t.id, 'TrialRequestStatusAwaitingApproval', 'Awaiting approval' FROM atranslation t where t.baselanguage = 'es'");
//french translations
await ExecQueryAsync("INSERT INTO atranslationitem(translationid,key,display) SELECT t.id, 'TrialLicenseRequest', 'Trial license request' FROM atranslation t where t.baselanguage = 'fr'");
@@ -1010,6 +1014,8 @@ $BODY$ LANGUAGE PLPGSQL STABLE");
await ExecQueryAsync("INSERT INTO atranslationitem(translationid,key,display) SELECT t.id, 'TrialRequestStatusNew', 'New' FROM atranslation t where t.baselanguage = 'fr'");
await ExecQueryAsync("INSERT INTO atranslationitem(translationid,key,display) SELECT t.id, 'TrialRequestStatusApproved', 'Approved' FROM atranslation t where t.baselanguage = 'fr'");
await ExecQueryAsync("INSERT INTO atranslationitem(translationid,key,display) SELECT t.id, 'TrialRequestStatusRejected', 'Rejected' FROM atranslation t where t.baselanguage = 'fr'");
await ExecQueryAsync("INSERT INTO atranslationitem(translationid,key,display) SELECT t.id, 'TrialRequestStatusAwaitingEmailValidation', 'Awaiting email validation' FROM atranslation t where t.baselanguage = 'fr'");
await ExecQueryAsync("INSERT INTO atranslationitem(translationid,key,display) SELECT t.id, 'TrialRequestStatusAwaitingApproval', 'Awaiting approval' FROM atranslation t where t.baselanguage = 'fr'");
//german translations
await ExecQueryAsync("INSERT INTO atranslationitem(translationid,key,display) SELECT t.id, 'TrialLicenseRequest', 'Trial license request' FROM atranslation t where t.baselanguage = 'de'");
@@ -1025,6 +1031,8 @@ $BODY$ LANGUAGE PLPGSQL STABLE");
await ExecQueryAsync("INSERT INTO atranslationitem(translationid,key,display) SELECT t.id, 'TrialRequestStatusNew', 'New' FROM atranslation t where t.baselanguage = 'de'");
await ExecQueryAsync("INSERT INTO atranslationitem(translationid,key,display) SELECT t.id, 'TrialRequestStatusApproved', 'Approved' FROM atranslation t where t.baselanguage = 'de'");
await ExecQueryAsync("INSERT INTO atranslationitem(translationid,key,display) SELECT t.id, 'TrialRequestStatusRejected', 'Rejected' FROM atranslation t where t.baselanguage = 'de'");
await ExecQueryAsync("INSERT INTO atranslationitem(translationid,key,display) SELECT t.id, 'TrialRequestStatusAwaitingEmailValidation', 'Awaiting email validation' FROM atranslation t where t.baselanguage = 'de'");
await ExecQueryAsync("INSERT INTO atranslationitem(translationid,key,display) SELECT t.id, 'TrialRequestStatusAwaitingApproval', 'Awaiting approval' FROM atranslation t where t.baselanguage = 'de'");
#endregion triallicenserequest
@@ -1387,7 +1395,7 @@ $BODY$ LANGUAGE PLPGSQL STABLE");
await SetSchemaLevelAsync(currentSchema);
}
//#########################################
//!!!!WARNING: BE SURE TO UPDATE THE DbUtil::EmptyBizDataFromDatabaseForSeedingOrImporting WHEN NEW TABLES ADDED!!!!

View File

@@ -26,7 +26,11 @@ namespace Sockeye.Util
internal const long MAX_TRANSLATION_UPLOAD_BYTES = 15728640;//15MiB limit; currently export file is 200kb * 50 maximum at a time = 15mb
//############################################################################################################
//############################
//MIGRATING FLAG INTERNAL ONLY
//used to speed up rockfish migration with bypasses to notification processing
internal static bool MIGRATING { get; set; }
//############################
//Diagnostic static values used during development, may not be related to config at all, this is just a convenient class to put them in
#if (DEBUG)