From: Jérôme Benoit Date: Sun, 9 Jun 2024 14:00:35 +0000 (+0200) Subject: fix: fix TxProfile removal with transaction id defined at Tx stop X-Git-Tag: v1.3.6~7 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=d020e249e5206699107d6e63d3d585a7e72e7830;p=e-mobility-charging-stations-simulator.git fix: fix TxProfile removal with transaction id defined at Tx stop Signed-off-by: Jérôme Benoit --- diff --git a/src/charging-station/Helpers.ts b/src/charging-station/Helpers.ts index 01c7f292..93df1ded 100644 --- a/src/charging-station/Helpers.ts +++ b/src/charging-station/Helpers.ts @@ -420,10 +420,11 @@ export const resetConnectorStatus = (connectorStatus: ConnectorStatus | undefine if (isNotEmptyArray(connectorStatus.chargingProfiles)) { connectorStatus.chargingProfiles = connectorStatus.chargingProfiles.filter( chargingProfile => - chargingProfile.chargingProfilePurpose !== ChargingProfilePurposeType.TX_PROFILE || - (chargingProfile.transactionId != null && + (chargingProfile.chargingProfilePurpose === ChargingProfilePurposeType.TX_PROFILE && + chargingProfile.transactionId != null && connectorStatus.transactionId != null && - chargingProfile.transactionId !== connectorStatus.transactionId) + chargingProfile.transactionId !== connectorStatus.transactionId) || + chargingProfile.chargingProfilePurpose !== ChargingProfilePurposeType.TX_PROFILE ) } resetAuthorizeConnectorStatus(connectorStatus)