refactor: cleanup reservation check condition
authorJérôme Benoit <jerome.benoit@sap.com>
Sun, 30 Jul 2023 17:01:03 +0000 (19:01 +0200)
committerJérôme Benoit <jerome.benoit@sap.com>
Sun, 30 Jul 2023 17:01:03 +0000 (19:01 +0200)
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
src/charging-station/ocpp/1.6/OCPP16IncomingRequestService.ts

index 87277e88c41e547f715acf1602351a34ed93c6da..cc16622a5bc72782cb3147bb4b67b68f4f153600 100644 (file)
@@ -833,11 +833,9 @@ export class OCPP16IncomingRequestService extends OCPPIncomingRequestService {
       chargingStation.getConnectorStatus(0)!.status === OCPP16ChargePointStatus.Reserved;
     if (
       (reserved &&
-        !(
-          chargingStation.getReservationBy('connectorId', transactionConnectorId)?.idTag === idTag
-        )) ||
+        chargingStation.getReservationBy('connectorId', transactionConnectorId)?.idTag !== idTag) ||
       (reservedOnConnectorZero &&
-        !(chargingStation.getReservationBy('connectorId', 0)?.idTag === idTag))
+        chargingStation.getReservationBy('connectorId', 0)?.idTag !== idTag)
     ) {
       return OCPP16Constants.OCPP_RESPONSE_REJECTED;
     }