bp - test adaptation to transfer reorg
MODIFY
package.json
package.json
"test:asset": "npm run test:jest -- test/**/AssetTest.ts",
"test:authentication": "npm run test:jest -- test/**/AuthenticationTest.ts",
"test:billing": "npm run test:jest -- test/**/BillingTest.ts",
+ "test:bp": "npm run test:jest -- test/**/BillingPlatformTest.ts",
"test:car": "npm run test:jest -- test/**/CarTest.ts",
"test:componentActivation": "npm run test:jest -- test/**/ComponentActivation*Test.ts",
"test:crypto": "npm run test:jest -- test/**/EncryptionSettingTest.ts",

MODIFY
src/authorization/AuthorizationsDefinition.ts
src/authorization/AuthorizationsDefinition.ts
@@ -512,7 +512,8 @@ export const AUTHORIZATION_DEFINITION: AuthorizationDefinition = {
resource: Entity.BILLING_TRANSFER,
action: [Action.LIST, Action.READ, Action.BILLING_FINALIZE_TRANSFER, Action.BILLING_SEND_TRANSFER],
attributes: [
- 'id', 'status', 'createdOn', 'sessionCounter', 'collectedFunds', 'collectedFees', 'transferAmount', 'accountID', 'transferExternalID',
+ 'id', 'status', 'createdOn', 'sessionCounter', 'collectedFunds', 'collectedFlatFees', 'collectedFees', 'totalConsumptionWh', 'totalDurationSecs',
+ 'transferAmount', 'accountID', 'transferExternalID',
'account.businessOwnerID', 'account.accountExternalID', 'businessOwner.name', 'businessOwner.firstName',
'platformFeeData.feeAmount', 'platformFeeData.feeTaxAmount', 'currency', 'invoice.documentNumber', 'invoice.totalAmount'
]

MODIFY
test/api/BillingPlatformTest.ts
test/api/BillingPlatformTest.ts
@@ -328,6 +328,8 @@ describeif(isBillingProperlyConfigured)('Billing Platform (utbillingplatform)',
await billingTestHelper.makeCurrentUserContextReadyForBilling();
// Generate a PAID transaction
const transactionID = await billingTestHelper.generateTransactionAndCheckBillingStatus(BillingInvoiceStatus.PAID);
+ // // Explicit call to dispatch collected funds
+ await billingTestHelper.billingImpl.dispatchCollectedFunds({ forceOperation: true });
// The transaction should now have a different status and know the final invoice number
const billingDataStop = await billingTestHelper.checkTransactionBillingData(transactionID, BillingInvoiceStatus.PAID);
// Check billing data

MODIFY
test/factories/BillingFactory.ts
test/factories/BillingFactory.ts
@@ -4,6 +4,8 @@ import { Factory } from 'rosie';
import faker from 'faker';
export const BillingTransferFactory = Factory.define<BillingTransfer>('billingtransfer')
+ .attr('sessionCounter', () => 0)
+ .attr('currency', () => 'USD')
.attr('collectedFunds', () => faker.datatype.number({ min: 70, max: 79 }))
.attr('collectedFlatFees', () => 0)
.attr('collectedFees', () => faker.datatype.number({ min: 0.7, max: 0.79 }))

bp - test adaptation to transfer reorg