From: Jérôme Benoit Date: Thu, 3 Aug 2023 13:39:02 +0000 (+0200) Subject: fix: remove transaction charging profiles at stop transaction X-Git-Tag: v1.2.20~33 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=dc347546238a2a8c5cf9f5e1c60dac29913e3948;p=e-mobility-charging-stations-simulator.git fix: remove transaction charging profiles at stop transaction Signed-off-by: Jérôme Benoit --- diff --git a/src/charging-station/Helpers.ts b/src/charging-station/Helpers.ts index 376199bf..0384da3e 100644 --- a/src/charging-station/Helpers.ts +++ b/src/charging-station/Helpers.ts @@ -339,6 +339,11 @@ export const initializeConnectorsMapStatus = ( }; export const resetConnectorStatus = (connectorStatus: ConnectorStatus): void => { + connectorStatus.chargingProfiles = isNotEmptyArray(connectorStatus.chargingProfiles) + ? connectorStatus.chargingProfiles?.filter( + (chargingProfile) => chargingProfile.transactionId !== connectorStatus?.transactionId, + ) + : []; connectorStatus.idTagLocalAuthorized = false; connectorStatus.idTagAuthorized = false; connectorStatus.transactionRemoteStarted = false;