bp - renaming
MODIFY
src/integration/billing/BillingIntegration.ts
src/integration/billing/BillingIntegration.ts
@@ -746,13 +746,13 @@ export default abstract class BillingIntegration {
const accountIDs = [ ...new Set(allAccountIDs)];
if (accountIDs.length > 0) {
for (const accountID of accountIDs) {
- await this.processTransfer4Account(accountID, billingInvoice);
+ await this.processTransferForAccount(accountID, billingInvoice);
}
}
}
}
- public async processTransfer4Account(accountID: string, invoice: BillingInvoice): Promise<void> {
+ public async processTransferForAccount(accountID: string, invoice: BillingInvoice): Promise<void> {
const sessions = invoice.sessions.filter((session) => accountID === session?.accountData?.accountID);
// Get the existing DRAFT transfer (if any)
const transfers = await BillingStorage.getTransfers(
@@ -784,7 +784,7 @@ export default abstract class BillingIntegration {
amountAsDecimal,
amount: amountAsDecimal.toNumber(),
roundedAmount: Utils.roundTo(amountAsDecimal, 2),
- platformFee: session.accountData.platformFeeStrategy
+ platformFeeStrategy: session.accountData.platformFeeStrategy
};
// Update the collection of sessions in the DRAFT transfer
transfer.sessions.push(sessionData);

MODIFY
src/storage/mongodb/BillingStorage.ts
src/storage/mongodb/BillingStorage.ts
@@ -347,10 +347,7 @@ export default class BillingStorage {
sessions: transfer.sessions.map((session) => ({
transactionID: session.transactionID,
amount: session.amount,
- platformFee: {
- flatFeePerSession: session.platformFee.flatFeePerSession,
- percentage: session.platformFee.percentage
- }
+ platformFee: session.platformFeeStrategy,
}))
};
if (transfer.platformFeeData) {

MODIFY
src/types/Billing.ts
src/types/Billing.ts
@@ -213,6 +213,6 @@ export interface BillingTransferSession {
amountAsDecimal: BillingAmount
amount: number; // ACHTUNG - That one should not include any taxes
roundedAmount: number;
- platformFee: BillingPlatformFeeStrategy;
+ platformFeeStrategy: BillingPlatformFeeStrategy;
}

MODIFY
test/factories/BillingFactory.ts
test/factories/BillingFactory.ts
@@ -20,7 +20,7 @@ export const BillingTransferFactory = Factory.define('billingtransfer')
export const BillingTransferSessionFactory = Factory.define('billingtransfersession')
.attr('transactionID', () => faker.datatype.number())
.attr('amount', () => faker.datatype.number())
- .attr('platformFee', () => ({
+ .attr('platformFeeStrategy', () => ({
flatFeePerSession: faker.datatype.number(),
percentage: faker.datatype.number(),
}));

bp - renaming