From 840c71e9535639e655d2e4e796ce5c24584a7675 Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Mon, 20 Jul 2020 23:19:54 +0000 Subject: [PATCH] --- .vscode/launch.json | 2 +- server/AyaNova/biz/NotifyEventProcessor.cs | 41 ++++++++++++++++++---- 2 files changed, 36 insertions(+), 7 deletions(-) diff --git a/.vscode/launch.json b/.vscode/launch.json index 396abc9b..bcfc56be 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -50,7 +50,7 @@ "AYANOVA_USE_URLS": "http://*:7575;", "AYANOVA_FOLDER_USER_FILES": "c:\\temp\\RavenTestData\\userfiles", "AYANOVA_FOLDER_BACKUP_FILES": "c:\\temp\\RavenTestData\\backupfiles", - "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\\PostgreSQLPortable_12.0\\App\\PgSQL\\bin\\" diff --git a/server/AyaNova/biz/NotifyEventProcessor.cs b/server/AyaNova/biz/NotifyEventProcessor.cs index a82e53be..d2511d85 100644 --- a/server/AyaNova/biz/NotifyEventProcessor.cs +++ b/server/AyaNova/biz/NotifyEventProcessor.cs @@ -152,7 +152,8 @@ namespace AyaNova.Biz ObjectId = newObject.Id, NotifySubscriptionId = sub.Id, //TODO: IdValue=((WorkOrder)newObject).WorkorderStatusId - EventDate = DateTime.UtcNow + EventDate = DateTime.UtcNow, + Name = newObject.Name }; await ct.NotifyEvent.AddAsync(n); log.LogTrace($"Adding NotifyEvent: [{n.ToString()}]"); @@ -218,7 +219,8 @@ namespace AyaNova.Biz AyaType = newObject.AyaType, ObjectId = newObject.Id, NotifySubscriptionId = sub.Id, - EventDate = DateTime.UtcNow + EventDate = DateTime.UtcNow, + Name = newObject.Name }; await ct.NotifyEvent.AddAsync(n); log.LogTrace($"Adding NotifyEvent: [{n.ToString()}]"); @@ -235,7 +237,15 @@ namespace AyaNova.Biz { if (TagsMatch(newObject.Tags, sub.Tags)) { - NotifyEvent n = new NotifyEvent() { EventType = NotifyEventType.ObjectCreated, UserId = sub.UserId, AyaType = newObject.AyaType, ObjectId = newObject.Id, NotifySubscriptionId = sub.Id }; + NotifyEvent n = new NotifyEvent() + { + EventType = NotifyEventType.ObjectCreated, + UserId = sub.UserId, + AyaType = newObject.AyaType, + ObjectId = newObject.Id, + NotifySubscriptionId = sub.Id, + Name = newObject.Name + }; await ct.NotifyEvent.AddAsync(n); log.LogTrace($"Adding NotifyEvent: [{n.ToString()}]"); SaveContext = true; @@ -273,7 +283,10 @@ namespace AyaNova.Biz // ObjectId = newObject.Id, // NotifySubscriptionId = sub.Id, // //TODO: IdValue=((WorkOrder)newObject).WorkorderStatusId - // EventDate = DateTime.UtcNow + // EventDate = DateTime.UtcNow, + //Name=newObject.Name + //, + // Name=newObject.Name // }; // await ct.NotifyEvent.AddAsync(n); // log.LogTrace($"Adding NotifyEvent: [{n.ToString()}]"); @@ -338,7 +351,15 @@ namespace AyaNova.Biz { if (TagsMatch(newObject.Tags, sub.Tags)) { - NotifyEvent n = new NotifyEvent() { EventType = NotifyEventType.ObjectModified, UserId = sub.UserId, AyaType = newObject.AyaType, ObjectId = newObject.Id, NotifySubscriptionId = sub.Id }; + NotifyEvent n = new NotifyEvent() + { + EventType = NotifyEventType.ObjectModified, + UserId = sub.UserId, + AyaType = newObject.AyaType, + ObjectId = newObject.Id, + NotifySubscriptionId = sub.Id, + Name = newObject.Name + }; await ct.NotifyEvent.AddAsync(n); log.LogTrace($"Adding NotifyEvent: [{n.ToString()}]"); SaveContext = true; @@ -373,7 +394,15 @@ namespace AyaNova.Biz if (TagsMatch(newObject.Tags, sub.Tags)) { //TODO: On deliver should point to history event log record or take from there and insert into delivery message? - NotifyEvent n = new NotifyEvent() { EventType = NotifyEventType.ObjectDeleted, UserId = sub.UserId, AyaType = newObject.AyaType, ObjectId = newObject.Id, NotifySubscriptionId = sub.Id, Message = newObject.Name }; + NotifyEvent n = new NotifyEvent() + { + EventType = NotifyEventType.ObjectDeleted, + UserId = sub.UserId, + AyaType = newObject.AyaType, + ObjectId = newObject.Id, + NotifySubscriptionId = sub.Id, + Message = newObject.Name + }; await ct.NotifyEvent.AddAsync(n); log.LogTrace($"Adding NotifyEvent: [{n.ToString()}]"); SaveContext = true;