Prechádzať zdrojové kódy

additional comment on Json notification checking

Enzo 1 rok pred
rodič
commit
06b8be7720

+ 3 - 0
documentations/notificationSynchronization.uml

@@ -0,0 +1,3 @@
+@startuml
+
+@enduml

+ 4 - 3
services/message-auditor.service.ts

@@ -53,7 +53,7 @@ export class MessageAuditorService implements MessageAuditorServiceInterface {
     private filterData(filters: any, message: MessageLog): boolean {
         let response: boolean = true //Just using this like a statemanagement
         let payload: BaseMessage = JSON.parse(message.appData.msgPayload as string) // Extract the payload from the messageLog first
-        this.verifyIfJsonDataIsString(payload) // Convert stringified nested payload if there's any
+        this.checkIfIsInPayloadDataFormat(payload) // Convert stringified nested payload if there's any
         // Making a separate function to cater to different multi filters conditions are coded below
         if (filters) { // if filters is not null
             if (Object.keys(filters).length > 1) {
@@ -185,8 +185,9 @@ export class MessageAuditorService implements MessageAuditorServiceInterface {
         }
     }
 
-    // Addtional checking for notification messages cases
-    private verifyIfJsonDataIsString(payload: BaseMessage | any) {
+    // Check in the case of notification messages, for the nested data properties
+    // Notification message may have multiple nested data properties that maybe in string format
+    private checkIfIsInPayloadDataFormat(payload: BaseMessage | any) {
         let parsedData: any
         if (payload.data.data.data && typeof payload.data.data.data === 'string') {
             parsedData = JSON.parse(payload.data.data.data)