pricing - TODO cleanup
MODIFY
src/integration/pricing/PricingFactory.ts
src/integration/pricing/PricingFactory.ts
@@ -27,8 +27,6 @@ export default class PricingFactory {
case PricingSettingsType.SIMPLE:
// Simple Pricing implementation
if (FeatureToggles.isFeatureActive(Feature.PRICING_NEW_MODEL)) {
- // TODO - to be clarified - feature hidden behind a feature toggle for now!
- // Do we need a dedicated PricingSettingsType?
pricingIntegrationImpl = new BuiltInPricingIntegration(tenant, pricingSetting.simple);
} else {
pricingIntegrationImpl = new SimplePricingIntegration(tenant, pricingSetting.simple);

MODIFY
src/integration/pricing/simple-pricing/BuiltInPricingIntegration.ts
src/integration/pricing/simple-pricing/BuiltInPricingIntegration.ts
@@ -12,10 +12,6 @@ import Tenant from '../../../types/Tenant';
import Transaction from '../../../types/Transaction';
import Utils from '../../../utils/Utils';
-// --------------------------------------------------------------------------------------------------
-// TODO - POC - BuiltInPricingIntegration is hidden behind a feature toggle
-// This concrete implementation of the PricingIntegration still relies on the SimplePricingSettings
-// --------------------------------------------------------------------------------------------------
export default class BuiltInPricingIntegration extends PricingIntegration<SimplePricingSetting> {
constructor(tenant: Tenant, readonly settings: SimplePricingSetting) {
super(tenant, settings);

MODIFY
src/server/ocpp/utils/OCPPUtils.ts
src/server/ocpp/utils/OCPPUtils.ts
@@ -567,7 +567,6 @@ export default class OCPPUtils {
// Update transaction
transaction.roundedPrice = Utils.truncTo(transaction.price, 2);
transaction.stop.price = transaction.currentCumulatedPrice;
- // transaction.stop.roundedPrice = Utils.truncTo(transaction.currentCumulatedPrice, 2);
transaction.stop.roundedPrice = transaction.currentCumulatedRoundedPrice;
await TransactionStorage.saveTransaction(tenant, transaction);
}
@@ -588,7 +587,6 @@ export default class OCPPUtils {
totalDurationSecs: transaction.currentTotalDurationSecs,
inactivityStatus: Utils.getInactivityStatusLevel(chargingStation, transaction.connectorId, transaction.currentTotalInactivitySecs),
price: transaction.currentCumulatedPrice,
- // roundedPrice: Utils.truncTo(transaction.currentCumulatedPrice, 2),
roundedPrice: transaction.currentCumulatedRoundedPrice,
priceUnit: transaction.priceUnit,
pricingSource: transaction.pricingSource,

MODIFY
src/server/rest/v1/service/UtilsService.ts
src/server/rest/v1/service/UtilsService.ts
@@ -1357,27 +1357,6 @@ export default class UtilsService {
}
}
- public static checkIfCompanyValid(company: Partial<Company>, req: Request): void {
- if (req.method !== 'POST' && !company.id) {
- throw new AppError({
- source: Constants.CENTRAL_SERVER,
- errorCode: HTTPError.GENERAL_ERROR,
- message: 'Company ID is mandatory',
- module: MODULE_NAME, method: 'checkIfCompanyValid',
- user: req.user.id
- });
- }
- if (!company.name) {
- throw new AppError({
- source: Constants.CENTRAL_SERVER,
- errorCode: HTTPError.GENERAL_ERROR,
- message: 'Company Name is mandatory',
- module: MODULE_NAME, method: 'checkIfCompanyValid',
- user: req.user.id
- });
- }
- }
-
public static checkIfPricingDefinitionValid(pricing: Partial<PricingDefinition>, req: Request): void {
if (req.method !== 'POST' && !pricing.id) {
throw new AppError({

pricing - TODO cleanup