From 8c3714812119821b47b4a589dea638ece913445a Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Thu, 23 Aug 2018 19:07:43 +0000 Subject: [PATCH] --- devdocs/specs/core-log-business.txt | 14 ++++++++++++-- server/AyaNova/biz/AyaEvent.cs | 23 +++++++++++++++++++++++ 2 files changed, 35 insertions(+), 2 deletions(-) create mode 100644 server/AyaNova/biz/AyaEvent.cs diff --git a/devdocs/specs/core-log-business.txt b/devdocs/specs/core-log-business.txt index c5b161a5..4fdae146 100644 --- a/devdocs/specs/core-log-business.txt +++ b/devdocs/specs/core-log-business.txt @@ -1,11 +1,13 @@ Business history log FROM CASE 79 -A central event log used to track changes to business objects and events of significance in AyaNova. -??Has some sort of checksum or verification so we can tell it wasn't fucked with +A central event log used to track major changes to business objects and major events of significance in AyaNova. +??Has some sort of checksum or verification so we can tell it wasn't fucked with (too hard to implement, would be something like a blockchain?) Consumed by various widgets for record history purposes Default feature, no need to turn on or off keeps logs for 45 days, users who want more can Items are only removed from log when source object is deleted (and replaced with a deleted entry and textual description of deleted item) +Needs a cleaner job that periodically looks for non-existant objects that are logged +Has to handle a scenario where there is no data for an object because in future we will likely have a purge feature or maybe a feature to turn it off and needs to accept that scenario EVENT_TYPES @@ -42,6 +44,14 @@ USERID, TEXTRA (text field to identify stuff that can't be retrieved from source object, i.e. deleted record name) +DELETION +-------- +The only way an entry is removed from the log is via deletion of the source object +When a source object is deleted, the entire history for that object is removed from the log and a new entry is created showing the deletion and textual representation of the object + - The record has the object type so no need to redundently store that, just the name: "1234" for workorder 1234 or "ABC Accounting" for the client name etc + + + TODO: 1) Implement this log and routes to interact with it 2) Implement an auto-prune job \ No newline at end of file diff --git a/server/AyaNova/biz/AyaEvent.cs b/server/AyaNova/biz/AyaEvent.cs new file mode 100644 index 00000000..7dc55bc5 --- /dev/null +++ b/server/AyaNova/biz/AyaEvent.cs @@ -0,0 +1,23 @@ +namespace AyaNova.Biz +{ + + + /// + /// All AyaNova event types + /// Used for central biz logging and notification + /// + public enum AyaEvent : int + { + //common events + Deleted = 0, + Created = 1, + Retrieved = 2, + Modified = 3 + + //specific events + + + } + + +}//eons