Jelajahi Sumber

Acknowledgement fix 2

Enzo 1 tahun lalu
induk
melakukan
06b53e6a0e

+ 1 - 1
dependencies/fisloggingservice

@@ -1 +1 @@
-Subproject commit 24cf18727fee5401364d2c83db8ac3b63c63b8b7
+Subproject commit 89de1b23819874fb4485632bbe8c331883e6fc8f

+ 20 - 3
services/acknowledgemeent.service.ts → services/acknowledgement.service.ts

@@ -1,9 +1,9 @@
 import { AnyObject } from "mongoose";
 import { map, Observable, of, tap } from "rxjs";
-import { Command, ResponseMessage } from "../dependencies/fisappmessagejsutilty/interface/export"
+import { Command, ResponseMessage, Uuid } from "../dependencies/fisappmessagejsutilty/interface/export"
 import { FisCreateMessageUtility } from "../dependencies/fisappmessagejsutilty/interface/export";
 import { LoggingService } from "../dependencies/fisloggingservice/services/logging-service";
-import { LogSetting } from "../dependencies/fisloggingservice/type/datatype";
+import { LogSetting, MessageLog } from "../dependencies/fisloggingservice/type/datatype";
 import { Acknowledgemeent, AcknowledgementLogSetting } from "../type/acknowledgement.interface";
 
 
@@ -79,7 +79,24 @@ export class AcknowledgementService implements Acknowledgemeent {
                 }
 
             ))
-        this.logService2.subscribe(acknowledgementToken) 
+        let acknowledgementTokenLogging: Observable<MessageLog> = obs.pipe(
+            map(
+                incoming_msg => {
+                    let finalResponse:MessageLog = {
+                        appLogLocId: this.settings2.setting.appLogId || "",
+                        appData: {
+                            msgId: new Uuid().generateId(),
+                            msgLogDateTime: new Date(),
+                            msgDateTime: new Date(),
+                            msgTag: ['Acknowledgement'],
+                            msgPayload: JSON.stringify(incoming_msg)
+                        }
+                    }
+                    return finalResponse
+                }
+            )
+        )
+        this.logService2.subscribe(acknowledgementTokenLogging) 
         return acknowledgementToken
     }
 }

+ 0 - 0
test/stream.ts → test/test-streamOBS.ts


+ 2 - 4
test/test.ts

@@ -1,7 +1,5 @@
-import { map, Observable, of, take } from "rxjs";
-import * as fs from "fs"
-import { AcknowledgementService } from "../services/acknowledgemeent.service";
-import { StreamingService } from "./stream";
+import { AcknowledgementService } from "../services/acknowledgement.service";
+import { StreamingService } from "./test-streamOBS";
 import { SyncrhonizationService } from "../services/synchronization.service";
 import { LogSetting } from "../dependencies/fisloggingservice/type/datatype";
 const acknowledge = new AcknowledgementService()