Clear connector transaction data when Preparing status notif is received
MODIFY
src/server/ocpp/services/OCPPService.ts
src/server/ocpp/services/OCPPService.ts
@@ -773,7 +773,8 @@ export default class OCPPService {
private async checkAndUpdateLastCompletedTransaction(tenant: Tenant, chargingStation: ChargingStation,
statusNotification: OCPPStatusNotificationRequestExtended, connector: Connector) {
// Check last transaction
- if (statusNotification.status === ChargePointStatus.AVAILABLE) {
+ if (statusNotification.status === ChargePointStatus.AVAILABLE ||
+ statusNotification.status === ChargePointStatus.PREPARING) {
// Get the last transaction
const lastTransaction = await TransactionStorage.getLastTransactionFromChargingStation(
tenant, chargingStation.id, connector.connectorId, { withUser: true });

Clear connector transaction data when Preparing status notif is received