pricing - additionak test to check pricing step gaps
MODIFY
test/api/BillingTest.ts
test/api/BillingTest.ts
import { BillingChargeInvoiceAction, BillingInvoiceStatus } from '../../src/types/Billing';
import { BillingSettings, BillingSettingsType } from '../../src/types/Setting';
import chai, { expect } from 'chai';
-import { BillingPeriodicOperationTaskConfig } from '../../src/types/TaskConfig';
+import { BillingPeriodicOperationTaskConfig } from '../../src/types/TaskConfig';
import BillingTestHelper from './BillingTestHelper';
import CentralServerService from './client/CentralServerService';
import Constants from '../../src/utils/Constants';
@@ -668,6 +668,17 @@ describeif(isBillingProperlyConfigured)('Billing', () => {
await billingTestHelper.checkTransactionBillingData(transactionID, BillingInvoiceStatus.PAID, 29.49);
});
+ it('should bill the ENERGY + CT(STEP80S) on COMBO CCS - DC', async () => {
+ await billingTestHelper.initChargingStationContext2TestFastCharger('E+CT(STEP80S)');
+ await billingTestHelper.userService.billingApi.forceSynchronizeUser({ id: billingTestHelper.userContext.id });
+ const userWithBillingData = await billingTestHelper.billingImpl.getUser(billingTestHelper.userContext);
+ await billingTestHelper.assignPaymentMethod(userWithBillingData, 'tok_fr');
+ const transactionID = await billingTestHelper.generateTransaction(billingTestHelper.userContext);
+ assert(transactionID, 'transactionID should not be null');
+ // Check that we have a new invoice with an invoiceID and an invoiceNumber
+ await billingTestHelper.checkTransactionBillingData(transactionID, BillingInvoiceStatus.PAID, 10.11);
+ });
+
it('should bill the FF+E with 2 tariffs on COMBO CCS - DC', async () => {
// A first Tariff for the ENERGY Only
await billingTestHelper.initChargingStationContext2TestFastCharger('FF+E');

MODIFY
test/api/BillingTestHelper.ts
test/api/BillingTestHelper.ts
@@ -212,6 +212,18 @@ export default class BillingTestHelper {
active: true
}
};
+ } else if (testMode === 'E+CT(STEP80S)') {
+ dimensions = {
+ energy: {
+ price: 0.30,
+ active: true
+ },
+ chargingTime: {
+ price: 0.60, // Euro per hour
+ stepSize: 80, // 1 minute + 20 seconds
+ active: true
+ }
+ };
} else if (testMode === 'E-After30mins+PT') {
// Create a second tariff with a different pricing strategy
dimensions = {

pricing - additionak test to check pricing step gaps