pricing - comments
MODIFY
src/integration/pricing/PricingFactory.ts
src/integration/pricing/PricingFactory.ts
@@ -25,10 +25,11 @@ export default class PricingFactory {
break;
// Simple Pricing
case PricingSettingsType.SIMPLE:
- // Simple Pricing implementation
if (FeatureToggles.isFeatureActive(Feature.PRICING_NEW_MODEL)) {
+ // Simple Pricing implementation
pricingIntegrationImpl = new BuiltInPricingIntegration(tenant, pricingSetting.simple);
} else {
+ // Built-in Pricing implementation
pricingIntegrationImpl = new SimplePricingIntegration(tenant, pricingSetting.simple);
}
break;

MODIFY
src/server/ocpp/utils/OCPPUtils.ts
src/server/ocpp/utils/OCPPUtils.ts
@@ -266,7 +266,6 @@ export default class OCPPUtils {
transaction.currentCumulatedPrice = pricedConsumption.amount;
transaction.currentCumulatedRoundedPrice = pricedConsumption.roundedAmount;
if (FeatureToggles.isFeatureActive(Feature.PRICING_NEW_MODEL)) {
- // TODO - To be clarified - check for the PricingSource instead?
transaction.pricingModel = pricedConsumption.pricingModel;
}
}

MODIFY
src/utils/Utils.ts
src/utils/Utils.ts
@@ -1088,8 +1088,6 @@ export default class Utils {
}
public static truncTo(value: number, scale: number): number {
- // const truncPower = Math.pow(10, scale);
- // return Math.trunc(value * truncPower) / truncPower;
const truncPower = Math.pow(10, scale);
return Utils.createDecimal(value).mul(truncPower).trunc().div(truncPower).toNumber();
}

pricing - comments