refactor: cleanup log messages
[e-mobility-charging-stations-simulator.git] / src / charging-station / broadcast-channel / ChargingStationWorkerBroadcastChannel.ts
index bb484be74eaf9e96f0e9c1eee7869d30a32229bd..422c964bcbedd232d28f1a7005efc09c7e5e989b 100644 (file)
@@ -15,6 +15,7 @@ import {
   DataTransferStatus,
   type DiagnosticsStatusNotificationRequest,
   type DiagnosticsStatusNotificationResponse,
+  type EmptyObject,
   type FirmwareStatusNotificationRequest,
   type FirmwareStatusNotificationResponse,
   type HeartbeatRequest,
@@ -42,11 +43,11 @@ import { OCPP16ServiceUtils } from '../ocpp';
 const moduleName = 'ChargingStationWorkerBroadcastChannel';
 
 type CommandResponse =
+  | EmptyObject
   | StartTransactionResponse
   | StopTransactionResponse
   | AuthorizeResponse
   | BootNotificationResponse
-  | StatusNotificationResponse
   | HeartbeatResponse
   | DataTransferResponse;
 
@@ -252,12 +253,12 @@ export class ChargingStationWorkerBroadcastChannel extends WorkerBroadcastChanne
     }
     const [uuid, command, requestPayload] = validatedMessageEvent.data as BroadcastChannelRequest;
     if (
-      !isNullOrUndefined(requestPayload?.hashIds) &&
-      requestPayload?.hashIds?.includes(this.chargingStation.stationInfo.hashId) === false
+      !isNullOrUndefined(requestPayload.hashIds) &&
+      requestPayload.hashIds?.includes(this.chargingStation.stationInfo.hashId) === false
     ) {
       return;
     }
-    if (!isNullOrUndefined(requestPayload?.hashId)) {
+    if (!isNullOrUndefined(requestPayload.hashId)) {
       logger.error(
         `${this.chargingStation.logPrefix()} ${moduleName}.requestHandler: 'hashId' field usage in PDU is deprecated, use 'hashIds' array instead`,
       );