Put back OCPI pricing to 0 instead of null
MODIFY
src/client/ocpi/CpoOCPIClient.ts
src/client/ocpi/CpoOCPIClient.ts
@@ -267,7 +267,7 @@ export default class CpoOCPIClient extends OCPIClient {
location: ocpiLocation,
currency: this.settings.currency,
status: OCPISessionStatus.PENDING,
- total_cost: null, // Never calculate the cost of OCPI transaction
+ total_cost: 0, // Never calculate the cost of OCPI transaction
last_updated: transaction.timestamp
};
// Call IOP
@@ -317,7 +317,7 @@ export default class CpoOCPIClient extends OCPIClient {
kwh: transaction.ocpiData.session.kwh,
last_updated: transaction.ocpiData.session.last_updated,
currency: transaction.ocpiData.session.currency,
- total_cost: null, // Never calculate the cost of OCPI transaction
+ total_cost: 0, // Never calculate the cost of OCPI transaction
status: transaction.ocpiData.session.status,
charging_periods: transaction.ocpiData.session.charging_periods
};
@@ -385,7 +385,7 @@ export default class CpoOCPIClient extends OCPIClient {
});
}
- public async postCdr(transaction: Transaction): Promise<void> {
+ public async pushCdr(transaction: Transaction): Promise<void> {
if (!transaction.stop) {
throw new BackendError({
...LoggingHelper.getTransactionProperties(transaction),
@@ -424,7 +424,7 @@ export default class CpoOCPIClient extends OCPIClient {
auth_method: transaction.ocpiData.session.auth_method,
location: transaction.ocpiData.session.location,
authorization_id: transaction.ocpiData.session.authorization_id,
- total_cost: null, // Never calculate the cost of OCPI transaction
+ total_cost: 0, // Never calculate the cost of OCPI transaction
charging_periods: await this.buildChargingPeriods(this.tenant, transaction),
last_updated: transaction.stop.timestamp
};

MODIFY
src/server/ocpi/OCPIFacade.ts
src/server/ocpi/OCPIFacade.ts
@@ -86,7 +86,7 @@ export default class OCPIFacade {
const ocpiClient = await OCPIFacade.checkAndGetOcpiCpoClient(
tenant, transaction, user, action);
// Send OCPI CDR
- await ocpiClient.postCdr(transaction);
+ await ocpiClient.pushCdr(transaction);
}
public static async checkAndSendTransactionCdr(tenant: Tenant, transaction: Transaction,

Put back OCPI pricing to 0 instead of null