import { map, Observable, tap } from "rxjs"; import { ResponseMessage } from "../dependencies/fisappmessagejsutilty/dependencies/dependencies"; import { FisCreateMessageUtility } from "../dependencies/fisappmessagejsutilty/services/fis.create.message"; import { LoggingService } from "../dependencies/fisloggingservice/services/logging-service"; import { LogSetting } from "../dependencies/fisloggingservice/type/datatype"; import { Acknowledgemeent } from "../interface/acknowledgement.interface"; export class AcknowledgementService implements Acknowledgemeent { private messageUtil: FisCreateMessageUtility = new FisCreateMessageUtility("FisAppID/Name") private settings: LogSetting = { storage: '', setting: { appId: '', appName: '', logLocName: '', logLocId: '', appLogLocId: '', appLocName: '', appLogId: '' } } constructor(private logService?: LoggingService) { } // set the data. I dont know what to set yet public async init(settings: LogSetting) { // console.log(settings) this.settings = settings this.logService.init(this.settings) // Error Cannot error properties of undefined (reading 'init') } // suppose to call logging service to give an observable type report for every message streamed public subscribe(obs: Observable): Observable { obs.subscribe((data) => { // console.log(data) this.logService.subscribe(data) }) let acknowledgementToken = obs.pipe( map( acknowledgement => acknowledgement // acknowledement => this.utilMessage.getResponseMessage(Parameters to be discussed) // this.logService(acknowledgement) )) this.logService.subscribe(acknowledgementToken) // Only log MessageObservable Type. Cannot log acknowledgement return acknowledgementToken// return response Message } }