From 164175431882deb1a48f8a89727f155e04d0f4df Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Thu, 12 Jan 2023 20:15:20 +0000 Subject: [PATCH] --- server/Controllers/EnumListController.cs | 43 +++++++++--------------- server/biz/NotifyEventType.cs | 12 +++++-- server/util/AySchema.cs | 36 ++++++++++++++++++-- todo.txt | 9 ++--- 4 files changed, 61 insertions(+), 39 deletions(-) diff --git a/server/Controllers/EnumListController.cs b/server/Controllers/EnumListController.cs index 008c5a3..fca0eb6 100644 --- a/server/Controllers/EnumListController.cs +++ b/server/Controllers/EnumListController.cs @@ -471,41 +471,22 @@ namespace Sockeye.Api.Controllers TranslationKeysToFetch.Add("NotifyEventObjectDeleted"); TranslationKeysToFetch.Add("NotifyEventObjectCreated"); TranslationKeysToFetch.Add("NotifyEventObjectModified"); - TranslationKeysToFetch.Add("NotifyEventWorkorderStatusChange"); - TranslationKeysToFetch.Add("NotifyEventContractExpiring"); - TranslationKeysToFetch.Add("NotifyEventCSRAccepted"); - TranslationKeysToFetch.Add("NotifyEventCSRRejected"); - TranslationKeysToFetch.Add("NotifyEventWorkorderCompleted"); - TranslationKeysToFetch.Add("NotifyEventQuoteStatusChange"); - TranslationKeysToFetch.Add("NotifyEventQuoteStatusAge"); TranslationKeysToFetch.Add("NotifyEventObjectAge"); - TranslationKeysToFetch.Add("NotifyEventServiceBankDepleted"); TranslationKeysToFetch.Add("NotifyEventReminderImminent"); - TranslationKeysToFetch.Add("NotifyEventScheduledOnWorkorder"); - TranslationKeysToFetch.Add("NotifyEventScheduledOnWorkorderImminent"); - TranslationKeysToFetch.Add("NotifyEventWorkorderCompletedStatusOverdue"); - TranslationKeysToFetch.Add("NotifyEventOutsideServiceOverdue"); - TranslationKeysToFetch.Add("NotifyEventOutsideServiceReceived"); - TranslationKeysToFetch.Add("NotifyEventPartRequestReceived"); TranslationKeysToFetch.Add("NotifyEventNotifyHealthCheck"); TranslationKeysToFetch.Add("NotifyEventBackupStatus"); - TranslationKeysToFetch.Add("NotifyEventCustomerServiceImminent"); - TranslationKeysToFetch.Add("NotifyEventPMStopGeneratingDateReached"); - TranslationKeysToFetch.Add("NotifyEventWorkorderTotalExceedsThreshold"); - TranslationKeysToFetch.Add("NotifyEventWorkorderStatusAge"); - TranslationKeysToFetch.Add("NotifyEventUnitWarrantyExpiry"); - TranslationKeysToFetch.Add("NotifyEventUnitMeterReadingMultipleExceeded"); TranslationKeysToFetch.Add("NotifyEventServerOperationsProblem"); TranslationKeysToFetch.Add("NotifyEventGeneralNotification"); - //TranslationKeysToFetch.Add("NotifyEventCopyOfCustomerNotification"); - TranslationKeysToFetch.Add("NotifyEventWorkorderCreatedForCustomer"); - TranslationKeysToFetch.Add("NotifyEventPMGenerationFailed"); - TranslationKeysToFetch.Add("NotifyEventPMInsufficientInventory"); TranslationKeysToFetch.Add("NotifyEventReviewImminent"); TranslationKeysToFetch.Add("NotifyEventDirectSMTPMessage"); - + TranslationKeysToFetch.Add("NotifyEventServerStateStatusChange"); + TranslationKeysToFetch.Add("NotifyEventServerStateStatusAge"); + TranslationKeysToFetch.Add("NotifyEventSubscriptionServerExpiring"); + TranslationKeysToFetch.Add("NotifyEventSubscriptionServerLastUpdateAge"); + TranslationKeysToFetch.Add("NotifyEventSubscriptionServerRequestReceived"); + TranslationKeysToFetch.Add("NotifyEventLicenseTrialRequestReceived"); + TranslationKeysToFetch.Add("NotifyEventPurchaseNotificationReceived"); var LT = await TranslationBiz.GetSubsetStaticAsync(TranslationKeysToFetch, translationId); - ReturnList.Add(new NameIdItem() { Name = LT["NotifyEventObjectDeleted"], Id = (long)NotifyEventType.ObjectDeleted }); ReturnList.Add(new NameIdItem() { Name = LT["NotifyEventObjectCreated"], Id = (long)NotifyEventType.ObjectCreated }); ReturnList.Add(new NameIdItem() { Name = LT["NotifyEventObjectModified"], Id = (long)NotifyEventType.ObjectModified }); @@ -516,8 +497,14 @@ namespace Sockeye.Api.Controllers ReturnList.Add(new NameIdItem() { Name = LT["NotifyEventBackupStatus"], Id = (long)NotifyEventType.BackupStatus }); ReturnList.Add(new NameIdItem() { Name = LT["NotifyEventServerOperationsProblem"], Id = (long)NotifyEventType.ServerOperationsProblem }); ReturnList.Add(new NameIdItem() { Name = LT["NotifyEventGeneralNotification"], Id = (long)NotifyEventType.GeneralNotification }); - ReturnList.Add(new NameIdItem() { Name = LT["NotifyEventDirectSMTPMessage"], Id = (long)NotifyEventType.DirectSMTPMessage }); + ReturnList.Add(new NameIdItem() { Name = LT["NotifyEventServerStateStatusChange"], Id = (long)NotifyEventType.ServerStateStatusChange }); + ReturnList.Add(new NameIdItem() { Name = LT["NotifyEventServerStateStatusAge"], Id = (long)NotifyEventType.ServerStateStatusAge }); + ReturnList.Add(new NameIdItem() { Name = LT["NotifyEventSubscriptionServerExpiring"], Id = (long)NotifyEventType.SubscriptionServerExpiring }); + ReturnList.Add(new NameIdItem() { Name = LT["NotifyEventSubscriptionServerLastUpdateAge"], Id = (long)NotifyEventType.SubscriptionServerLastUpdateAge }); + ReturnList.Add(new NameIdItem() { Name = LT["NotifyEventSubscriptionServerRequestReceived"], Id = (long)NotifyEventType.SubscriptionServerRequestReceived }); + ReturnList.Add(new NameIdItem() { Name = LT["NotifyEventLicenseTrialRequestReceived"], Id = (long)NotifyEventType.LicenseTrialRequestReceived }); + ReturnList.Add(new NameIdItem() { Name = LT["NotifyEventPurchaseNotificationReceived"], Id = (long)NotifyEventType.PurchaseNotificationReceived }); } else if (keyNameInLowerCase == StringUtil.TrimTypeName(typeof(NotifyDeliveryMethod).ToString()).ToLowerInvariant()) @@ -588,7 +575,7 @@ namespace Sockeye.Api.Controllers ReturnList.Add(new NameIdItem() { Name = LT["ProductGroupRavenPerpetual"], Id = (long)ProductGroup.RavenPerpetual }); ReturnList.Add(new NameIdItem() { Name = LT["ProductGroupRavenSubscription"], Id = (long)ProductGroup.RavenSubscription }); } - else if (keyNameInLowerCase == StringUtil.TrimTypeName(typeof(ServerState).ToString()).ToLowerInvariant()) + else if (keyNameInLowerCase == StringUtil.TrimTypeName(typeof(ServerState).ToString()).ToLowerInvariant()) { TranslationKeysToFetch.Add("ServerStateRequested"); TranslationKeysToFetch.Add("ServerStateActiveHealthy"); diff --git a/server/biz/NotifyEventType.cs b/server/biz/NotifyEventType.cs index 5fee7a8..725edb4 100644 --- a/server/biz/NotifyEventType.cs +++ b/server/biz/NotifyEventType.cs @@ -28,10 +28,16 @@ Inspiring quotes used to help complete this huge project by myself NotifyHealthCheck = 19,//* NO OBJECT, direct subscription to receive recurring daily notify system "ping" sent out between 8am and 10am once every 24 hours minimum every day server local time BackupStatus = 20,//* NO OBJECT, direct subscription to receive results of last backup operation GeneralNotification = 27,//* NO OBJECT old quick notification, refers now to any direct text notification internal or user to user used for system notifications (default delivers in app but user can opt to also get email) - ServerOperationsProblem = 28,//* NO OBJECT and serious issue with server operations requiring intervention, + ServerOperationsProblem = 28,//* NO OBJECT and serious issue with SOCKEY server (NOT CUSTOMER SUBSCRIPTION SERVER) operations requiring intervention, ReviewImminent = 34,//*Review object, Advance notice setting tag conditional - DirectSMTPMessage= 35 //Used internally when sending a message via email directly to a Customer (initially) and possibly other objects in future. Shows in sent log but not user subscribable - + DirectSMTPMessage= 35, //Used internally when sending a message via email directly to a Customer (initially) and possibly other objects in future. Shows in sent log but not user subscribable + ServerStateStatusChange = 36, + ServerStateStatusAge=37, + SubscriptionServerExpiring = 38, + SubscriptionServerLastUpdateAge = 39, + SubscriptionServerRequestReceived = 40, + LicenseTrialRequestReceived = 41, + PurchaseNotificationReceived = 42 //NEW ITEMS REQUIRE translation KEYS } diff --git a/server/util/AySchema.cs b/server/util/AySchema.cs index e45ed9b..9cfe2e4 100644 --- a/server/util/AySchema.cs +++ b/server/util/AySchema.cs @@ -1272,20 +1272,52 @@ $BODY$ LANGUAGE PLPGSQL STABLE"); #endregion gzcase - #region CUSTOMER ADDITIONS + #region ADDITIONAL //english translations await ExecQueryAsync("INSERT INTO atranslationitem(translationid,key,display) SELECT t.id, 'DoNotContact', 'Do not contact' FROM atranslation t where t.baselanguage = 'en'"); + await ExecQueryAsync("INSERT INTO atranslationitem(translationid,key,display) SELECT t.id, 'NotifyEventServerStateStatusChange', 'Server status changed' FROM atranslation t where t.baselanguage = 'en'"); + await ExecQueryAsync("INSERT INTO atranslationitem(translationid,key,display) SELECT t.id, 'NotifyEventServerStateStatusAge', 'Server status age' FROM atranslation t where t.baselanguage = 'en'"); + await ExecQueryAsync("INSERT INTO atranslationitem(translationid,key,display) SELECT t.id, 'NotifyEventSubscriptionServerExpiring', 'Subscription server expiring' FROM atranslation t where t.baselanguage = 'en'"); + await ExecQueryAsync("INSERT INTO atranslationitem(translationid,key,display) SELECT t.id, 'NotifyEventSubscriptionServerLastUpdateAge', 'Subscription server last update age' FROM atranslation t where t.baselanguage = 'en'"); + await ExecQueryAsync("INSERT INTO atranslationitem(translationid,key,display) SELECT t.id, 'NotifyEventSubscriptionServerRequestReceived', 'Subscription server requested' FROM atranslation t where t.baselanguage = 'en'"); + await ExecQueryAsync("INSERT INTO atranslationitem(translationid,key,display) SELECT t.id, 'NotifyEventLicenseTrialRequestReceived', 'Trial license request' FROM atranslation t where t.baselanguage = 'en'"); + await ExecQueryAsync("INSERT INTO atranslationitem(translationid,key,display) SELECT t.id, 'NotifyEventPurchaseNotificationReceived', 'Purchase notification received' FROM atranslation t where t.baselanguage = 'en'"); + //spanish translations await ExecQueryAsync("INSERT INTO atranslationitem(translationid,key,display) SELECT t.id, 'DoNotContact', 'Do not contact' FROM atranslation t where t.baselanguage = 'es'"); + await ExecQueryAsync("INSERT INTO atranslationitem(translationid,key,display) SELECT t.id, 'NotifyEventServerStateStatusChange', 'Server status changed' FROM atranslation t where t.baselanguage = 'es'"); + await ExecQueryAsync("INSERT INTO atranslationitem(translationid,key,display) SELECT t.id, 'NotifyEventServerStateStatusAge', 'Server status age' FROM atranslation t where t.baselanguage = 'es'"); + await ExecQueryAsync("INSERT INTO atranslationitem(translationid,key,display) SELECT t.id, 'NotifyEventSubscriptionServerExpiring', 'Subscription server expiring' FROM atranslation t where t.baselanguage = 'es'"); + await ExecQueryAsync("INSERT INTO atranslationitem(translationid,key,display) SELECT t.id, 'NotifyEventSubscriptionServerLastUpdateAge', 'Subscription server last update age' FROM atranslation t where t.baselanguage = 'es'"); + await ExecQueryAsync("INSERT INTO atranslationitem(translationid,key,display) SELECT t.id, 'NotifyEventSubscriptionServerRequestReceived', 'Subscription server requested' FROM atranslation t where t.baselanguage = 'es'"); + await ExecQueryAsync("INSERT INTO atranslationitem(translationid,key,display) SELECT t.id, 'NotifyEventLicenseTrialRequestReceived', 'Trial license request' FROM atranslation t where t.baselanguage = 'es'"); + await ExecQueryAsync("INSERT INTO atranslationitem(translationid,key,display) SELECT t.id, 'NotifyEventPurchaseNotificationReceived', 'Purchase notification received' FROM atranslation t where t.baselanguage = 'es'"); + //french translations await ExecQueryAsync("INSERT INTO atranslationitem(translationid,key,display) SELECT t.id, 'DoNotContact', 'Do not contact' FROM atranslation t where t.baselanguage = 'fr'"); + await ExecQueryAsync("INSERT INTO atranslationitem(translationid,key,display) SELECT t.id, 'NotifyEventServerStateStatusChange', 'Server status changed' FROM atranslation t where t.baselanguage = 'fr'"); + await ExecQueryAsync("INSERT INTO atranslationitem(translationid,key,display) SELECT t.id, 'NotifyEventServerStateStatusAge', 'Server status age' FROM atranslation t where t.baselanguage = 'fr'"); + await ExecQueryAsync("INSERT INTO atranslationitem(translationid,key,display) SELECT t.id, 'NotifyEventSubscriptionServerExpiring', 'Subscription server expiring' FROM atranslation t where t.baselanguage = 'fr'"); + await ExecQueryAsync("INSERT INTO atranslationitem(translationid,key,display) SELECT t.id, 'NotifyEventSubscriptionServerLastUpdateAge', 'Subscription server last update age' FROM atranslation t where t.baselanguage = 'fr'"); + await ExecQueryAsync("INSERT INTO atranslationitem(translationid,key,display) SELECT t.id, 'NotifyEventSubscriptionServerRequestReceived', 'Subscription server requested' FROM atranslation t where t.baselanguage = 'fr'"); + await ExecQueryAsync("INSERT INTO atranslationitem(translationid,key,display) SELECT t.id, 'NotifyEventLicenseTrialRequestReceived', 'Trial license request' FROM atranslation t where t.baselanguage = 'fr'"); + await ExecQueryAsync("INSERT INTO atranslationitem(translationid,key,display) SELECT t.id, 'NotifyEventPurchaseNotificationReceived', 'Purchase notification received' FROM atranslation t where t.baselanguage = 'fr'"); + //german translations await ExecQueryAsync("INSERT INTO atranslationitem(translationid,key,display) SELECT t.id, 'DoNotContact', 'Do not contact' FROM atranslation t where t.baselanguage = 'de'"); + await ExecQueryAsync("INSERT INTO atranslationitem(translationid,key,display) SELECT t.id, 'NotifyEventServerStateStatusChange', 'Server status changed' FROM atranslation t where t.baselanguage = 'de'"); + await ExecQueryAsync("INSERT INTO atranslationitem(translationid,key,display) SELECT t.id, 'NotifyEventServerStateStatusAge', 'Server status age' FROM atranslation t where t.baselanguage = 'de'"); + await ExecQueryAsync("INSERT INTO atranslationitem(translationid,key,display) SELECT t.id, 'NotifyEventSubscriptionServerExpiring', 'Subscription server expiring' FROM atranslation t where t.baselanguage = 'de'"); + await ExecQueryAsync("INSERT INTO atranslationitem(translationid,key,display) SELECT t.id, 'NotifyEventSubscriptionServerLastUpdateAge', 'Subscription server last update age' FROM atranslation t where t.baselanguage = 'de'"); + await ExecQueryAsync("INSERT INTO atranslationitem(translationid,key,display) SELECT t.id, 'NotifyEventSubscriptionServerRequestReceived', 'Subscription server requested' FROM atranslation t where t.baselanguage = 'de'"); + await ExecQueryAsync("INSERT INTO atranslationitem(translationid,key,display) SELECT t.id, 'NotifyEventLicenseTrialRequestReceived', 'Trial license request' FROM atranslation t where t.baselanguage = 'de'"); + await ExecQueryAsync("INSERT INTO atranslationitem(translationid,key,display) SELECT t.id, 'NotifyEventPurchaseNotificationReceived', 'Purchase notification received' FROM atranslation t where t.baselanguage = 'de'"); - #endregion customer additions + + #endregion additional currentSchema = 16; await SetSchemaLevelAsync(currentSchema); diff --git a/todo.txt b/todo.txt index 923a575..600a8b8 100644 --- a/todo.txt +++ b/todo.txt @@ -51,7 +51,8 @@ TODO: - Button to trigger D.O. API to requisition server automatically, spin it up etc - +- Add ui to front the route under /api/v8/license/v7-reset-manager-creds +- Need ui that shows money required for paying future for yearly subs so at a glance know what money need in bank each month //////////////////////////////////////////////////////////////////////////////////////////// @@ -151,11 +152,7 @@ LICENSE_SERVER_URL_CALLISTO = "https://callisto.ayanova.com/";//4th production DTR -- Add ui to front the route under /api/v8/license/v7-reset-manager-creds -License routes test locally and ensure works for v7 and v8 -automatic jobs to create purchase record from vendor data -send license emails based on event etc, really gets into the new stuff here -Need ui that shows money required for paying future for yearly subs so at a glance know what money need in bank each month + Also, sidebar, check if can pay d.o. in advance, or do I want that??