pricing - method renamed + cleanup
MODIFY
src/integration/pricing/ConsumptionPricer.ts
src/integration/pricing/ConsumptionPricer.ts
@@ -203,20 +203,20 @@ export default class ConsumptionPricer {
if (consumptionWh > 0) {
const pricedData = this.priceTimeDimension(dimensionToPrice, this.getAbsorbedChargingTime());
if (pricedData) {
- this.absorbedChargingTime();
+ this.absorbChargingTime();
}
return this.enrichPricedData(pricedData, activePricingDefinition);
}
}
// IMPORTANT!
- this.absorbedChargingTime();
+ this.absorbChargingTime();
}
private getAbsorbedChargingTime() {
return this.pricingModel.pricerContext.lastAbsorbedChargingTime || this.pricingModel.pricerContext.sessionStartDate;
}
- private absorbedChargingTime() {
+ private absorbChargingTime() {
// Mark the charging time as already priced - to avoid pricing it twice
// This may happen when combining several tariffs in a single session
this.pricingModel.pricerContext.lastAbsorbedChargingTime = this.consumptionData.endedAt;
@@ -229,25 +229,24 @@ export default class ConsumptionPricer {
const totalInactivitySecs = this.consumptionData?.totalInactivitySecs || 0;
const cumulatedConsumptionDataWh = this.consumptionData?.cumulatedConsumptionWh || 0;
const consumptionWh = this.consumptionData?.consumptionWh || 0;
- // Price the parking time only it makes sense - NOT during the warmup!
+ // Price the parking time only when it makes sense - NOT during the warmup!
if (totalInactivitySecs > 0 && cumulatedConsumptionDataWh > 0 && consumptionWh <= 0) {
- // TODO - to be clarified - do we pay the first step before consuming it or not?
const pricedData = this.priceTimeDimension(dimensionToPrice, this.getAbsorbedParkingTime());
if (pricedData) {
- this.absorbedParkingTime();
+ this.absorbParkingTime();
}
return this.enrichPricedData(pricedData, activePricingDefinition);
}
}
// IMPORTANT!
- this.absorbedParkingTime();
+ this.absorbParkingTime();
}
private getAbsorbedParkingTime() {
return this.pricingModel.pricerContext.lastAbsorbedParkingTime || this.pricingModel.pricerContext.sessionStartDate;
}
- private absorbedParkingTime() {
+ private absorbParkingTime() {
// Mark the parking time as already priced - to avoid pricing it twice
// This may happen when combining several tariffs in a single session
this.pricingModel.pricerContext.lastAbsorbedParkingTime = this.consumptionData.endedAt;

pricing - method renamed + cleanup