From 6f3e57f0dc46c0a8c5030d954576710258f9bb7e Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Wed, 16 Jun 2021 18:57:36 +0000 Subject: [PATCH] --- .vscode/launch.json | 2 +- server/AyaNova/Controllers/EnumListController.cs | 4 ++-- server/AyaNova/biz/NotifyEventType.cs | 2 +- server/AyaNova/biz/UserBiz.cs | 7 ++++++- server/AyaNova/models/GlobalBizSettings.cs | 7 ++++++- server/AyaNova/util/AySchema.cs | 1 + 6 files changed, 17 insertions(+), 6 deletions(-) diff --git a/.vscode/launch.json b/.vscode/launch.json index b77f3b95..fcc80a75 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -53,7 +53,7 @@ "AYANOVA_FOLDER_USER_FILES": "c:\\temp\\RavenTestData\\userfiles", "AYANOVA_FOLDER_BACKUP_FILES": "c:\\temp\\RavenTestData\\backupfiles", "AYANOVA_FOLDER_TEMPORARY_SERVER_FILES": "c:\\temp\\RavenTestData\\tempfiles", - "AYANOVA_SERVER_TEST_MODE": "false", + "AYANOVA_SERVER_TEST_MODE": "true", "AYANOVA_SERVER_TEST_MODE_SEEDLEVEL": "small", "AYANOVA_SERVER_TEST_MODE_TZ_OFFSET": "-7", "AYANOVA_BACKUP_PG_DUMP_PATH": "C:\\data\\code\\postgres_13\\bin\\" diff --git a/server/AyaNova/Controllers/EnumListController.cs b/server/AyaNova/Controllers/EnumListController.cs index 072f0835..81d74bfa 100644 --- a/server/AyaNova/Controllers/EnumListController.cs +++ b/server/AyaNova/Controllers/EnumListController.cs @@ -380,7 +380,7 @@ namespace AyaNova.Api.Controllers TranslationKeysToFetch.Add("NotifyEventContractExpiring"); TranslationKeysToFetch.Add("NotifyEventCSRAccepted"); TranslationKeysToFetch.Add("NotifyEventCSRRejected"); - //TranslationKeysToFetch.Add("NotifyEventWorkorderCompleted"); REMOVED REDUNDANT COVERED BY OTHERS + TranslationKeysToFetch.Add("NotifyEventWorkorderCompleted"); TranslationKeysToFetch.Add("NotifyEventQuoteStatusChange"); TranslationKeysToFetch.Add("NotifyEventQuoteStatusAge"); TranslationKeysToFetch.Add("NotifyEventObjectAge"); @@ -415,7 +415,7 @@ namespace AyaNova.Api.Controllers ReturnList.Add(new NameIdItem() { Name = LT["NotifyEventContractExpiring"], Id = (long)NotifyEventType.ContractExpiring }); ReturnList.Add(new NameIdItem() { Name = LT["NotifyEventCSRAccepted"], Id = (long)NotifyEventType.CSRAccepted }); ReturnList.Add(new NameIdItem() { Name = LT["NotifyEventCSRRejected"], Id = (long)NotifyEventType.CSRRejected }); - //ReturnList.Add(new NameIdItem() { Name = LT["NotifyEventWorkorderCompleted"], Id = (long)NotifyEventType.WorkorderCompleted }); + ReturnList.Add(new NameIdItem() { Name = LT["NotifyEventWorkorderCompleted"], Id = (long)NotifyEventType.WorkorderCompleted }); ReturnList.Add(new NameIdItem() { Name = LT["NotifyEventQuoteStatusChange"], Id = (long)NotifyEventType.QuoteStatusChange }); ReturnList.Add(new NameIdItem() { Name = LT["NotifyEventQuoteStatusAge"], Id = (long)NotifyEventType.QuoteStatusAge }); ReturnList.Add(new NameIdItem() { Name = LT["NotifyEventObjectAge"], Id = (long)NotifyEventType.ObjectAge }); diff --git a/server/AyaNova/biz/NotifyEventType.cs b/server/AyaNova/biz/NotifyEventType.cs index 168ea1ba..d0baf341 100644 --- a/server/AyaNova/biz/NotifyEventType.cs +++ b/server/AyaNova/biz/NotifyEventType.cs @@ -40,7 +40,7 @@ namespace AyaNova.Biz 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, QuoteStatusAge = 29,//* Quote object Created / Updated, conditional on exact status selected IdValue, Tags conditional, advance notice can be set - //WorkorderCompleted = 30, HMM Not really, customer can't just see all status, will leave out for now-->REMOVED REDUNDANT COVERED BY OTHERS//*Service work order is set to any status that is flagged as a "Completed" type of status. Customer & User + WorkorderCompleted = 30, //*Service work order is set to any status that is flagged as a "Completed" type of status. Customer & User (Note this is for users that don't want or can't pick status change to completed type) WorkorderCreatedForCustomer = 31, //*Service work order is created for Customer, only applies to that customer user notify sub for that customer, customer id is in conditional ID value for subscription //WorkorderCompletedFollowUp = 32, REMOVED REDUNDANT COVERED BY OTHERS //* Service workorder closed status follow up again after this many TIMESPAN SendUserCredentials = 33 // Internal System use only: When user generates new credentials and sends them this is the notification type for that see UserBiz GenerateCredsAndEmailUser diff --git a/server/AyaNova/biz/UserBiz.cs b/server/AyaNova/biz/UserBiz.cs index 712b7616..004cd1b8 100644 --- a/server/AyaNova/biz/UserBiz.cs +++ b/server/AyaNova/biz/UserBiz.cs @@ -172,7 +172,12 @@ namespace AyaNova.Biz CustomerUserEffectiveRightsAllowed(AyaNova.Util.ServerGlobalBizSettings.Cache.CustomerAllowNotifyWOCreated, AllTags, AyaNova.Util.ServerGlobalBizSettings.Cache.CustomerAllowNotifyWOCreatedInTags, - AyaNova.Util.ServerGlobalBizSettings.Cache.CustomerAllowNotifyWOCreatedOutTags) + AyaNova.Util.ServerGlobalBizSettings.Cache.CustomerAllowNotifyWOCreatedOutTags), + + CustomerUserEffectiveRightsAllowed(AyaNova.Util.ServerGlobalBizSettings.Cache.CustomerAllowNotifyWOCompleted, + AllTags, + AyaNova.Util.ServerGlobalBizSettings.Cache.CustomerAllowNotifyWOCompletedInTags, + AyaNova.Util.ServerGlobalBizSettings.Cache.CustomerAllowNotifyWOCompletedOutTags) ); } diff --git a/server/AyaNova/models/GlobalBizSettings.cs b/server/AyaNova/models/GlobalBizSettings.cs index 4e2ca77a..a7433ef6 100644 --- a/server/AyaNova/models/GlobalBizSettings.cs +++ b/server/AyaNova/models/GlobalBizSettings.cs @@ -77,6 +77,11 @@ namespace AyaNova.Models public List CustomerAllowNotifyWOCreatedInTags { get; set; } = new List(); public List CustomerAllowNotifyWOCreatedOutTags { get; set; } = new List(); + public bool CustomerAllowNotifyWOCompleted { get; set; } + public List CustomerAllowNotifyWOCompletedInTags { get; set; } = new List(); + public List CustomerAllowNotifyWOCompletedOutTags { get; set; } = new List(); + + @@ -90,7 +95,7 @@ namespace AyaNova.Models } //Used internally and at client end as extended rights atop roles system in relation only to Contact (customer type users) - public record CustomerRightsRecord(bool CSR, bool WO, bool WOWIKI, bool UserSettings, bool NotifyServiceImminent, bool NotifyCSRAccepted, bool NotifyCSRRejected, bool NotifyWOCreated); + public record CustomerRightsRecord(bool CSR, bool WO, bool WOWIKI, bool UserSettings, bool NotifyServiceImminent, bool NotifyCSRAccepted, bool NotifyCSRRejected, bool NotifyWOCreated, bool NotifyWOCompleted); } /* CREATE TABLE [dbo].[AGLOBAL]( diff --git a/server/AyaNova/util/AySchema.cs b/server/AyaNova/util/AySchema.cs index e9bed2cf..677ea9e8 100644 --- a/server/AyaNova/util/AySchema.cs +++ b/server/AyaNova/util/AySchema.cs @@ -265,6 +265,7 @@ namespace AyaNova.Util + "customerallownotifycsraccepted BOOL DEFAULT FALSE, customerallownotifycsracceptedintags VARCHAR(255) ARRAY, customerallownotifycsracceptedouttags VARCHAR(255) ARRAY, " + "customerallownotifycsrrejected BOOL DEFAULT FALSE, customerallownotifycsrrejectedintags VARCHAR(255) ARRAY, customerallownotifycsrrejectedouttags VARCHAR(255) ARRAY, " + "customerallownotifywocreated BOOL DEFAULT FALSE, customerallownotifywocreatedintags VARCHAR(255) ARRAY, customerallownotifywocreatedouttags VARCHAR(255) ARRAY " + + "customerallownotifywocompleted BOOL DEFAULT FALSE, customerallownotifywocompletedintags VARCHAR(255) ARRAY, customerallownotifywocompletedouttags VARCHAR(255) ARRAY " + ")"); //create global ops BACKUP settings table