refactor: uniformize log messages
[e-mobility-charging-stations-simulator.git] / src / charging-station / ocpp / OCPPResponseService.ts
index c66a16dad839a4fbcd47e250341d4d6e15b9a823..c77308907c6dac130338a5eb03a3ce1008b2ca0b 100644 (file)
@@ -11,7 +11,7 @@ import type {
   OCPPVersion,
   RequestCommand,
 } from '../../types';
-import { logger } from '../../utils/Logger';
+import { logger } from '../../utils';
 
 const moduleName = 'OCPPResponseService';
 
@@ -31,8 +31,18 @@ export abstract class OCPPResponseService {
       multipleOfPrecision: 2,
     });
     ajvFormats(this.ajv);
-    this.responseHandler.bind(this);
-    this.validateResponsePayload.bind(this);
+    this.responseHandler = this.responseHandler.bind(this) as (
+      chargingStation: ChargingStation,
+      commandName: RequestCommand,
+      payload: JsonType,
+      requestPayload: JsonType
+    ) => Promise<void>;
+    this.validateResponsePayload = this.validateResponsePayload.bind(this) as <T extends JsonType>(
+      chargingStation: ChargingStation,
+      commandName: RequestCommand,
+      schema: JSONSchemaType<T>,
+      payload: T
+    ) => boolean;
   }
 
   public static getInstance<T extends OCPPResponseService>(this: new () => T): T {