bp - cleanup - unused interface removal
MODIFY
src/integration/billing/BillingIntegration.ts
src/integration/billing/BillingIntegration.ts
/* eslint-disable @typescript-eslint/member-ordering */
-import { AsyncTaskType, AsyncTasks } from '../../types/AsyncTask';
-import { BillingAccount, BillingAccountSessionFee, BillingChargeInvoiceAction, BillingDataTransactionStart, BillingDataTransactionStop, BillingDataTransactionUpdate, BillingInvoice, BillingInvoiceItem, BillingInvoiceStatus, BillingOperationResult, BillingPaymentMethod, BillingPlatformFeeStrategy, BillingPlatformInvoice, BillingSessionAccountData, BillingSessionData, BillingStatus, BillingTax, BillingTransfer, BillingTransferSession, BillingTransferStatus, BillingUser, TransactionBillingData } from '../../types/Billing';
+import { BillingAccount, BillingChargeInvoiceAction, BillingDataTransactionStart, BillingDataTransactionStop, BillingDataTransactionUpdate, BillingInvoice, BillingInvoiceItem, BillingInvoiceStatus, BillingOperationResult, BillingPaymentMethod, BillingPlatformFeeStrategy, BillingPlatformInvoice, BillingSessionAccountData, BillingStatus, BillingTax, BillingTransfer, BillingTransferStatus, BillingUser } from '../../types/Billing';
import { BillingPeriodicOperationTaskConfig, DispatchFundsTaskConfig } from '../../types/TaskConfig';
import Tenant, { TenantComponents } from '../../types/Tenant';
import Transaction, { CollectedFundReport, StartTransactionErrorCode } from '../../types/Transaction';
import User, { UserStatus } from '../../types/User';
-import AsyncTaskBuilder from '../../async-task/AsyncTaskBuilder';
import BackendError from '../../exception/BackendError';
-import BillingHelpers from './BillingHelpers';
import { BillingSettings } from '../../types/Setting';
import BillingStorage from '../../storage/mongodb/BillingStorage';
import ChargingStation from '../../types/ChargingStation';

MODIFY
src/integration/billing/stripe/StripeBillingIntegration.ts
src/integration/billing/stripe/StripeBillingIntegration.ts
import { AsyncTaskType, AsyncTasks } from '../../../types/AsyncTask';
/* eslint-disable @typescript-eslint/member-ordering */
-import { BillingAccount, BillingAccountSessionFee, BillingDataTransactionStart, BillingDataTransactionStop, BillingDataTransactionUpdate, BillingInvoice, BillingInvoiceItem, BillingInvoiceStatus, BillingOperationResult, BillingPaymentMethod, BillingPlatformInvoice, BillingSessionAccountData, BillingStatus, BillingTax, BillingTransfer, BillingTransferSession, BillingUser, BillingUserData } from '../../../types/Billing';
+import { BillingAccount, BillingDataTransactionStart, BillingDataTransactionStop, BillingDataTransactionUpdate, BillingInvoice, BillingInvoiceItem, BillingInvoiceStatus, BillingOperationResult, BillingPaymentMethod, BillingPlatformInvoice, BillingSessionAccountData, BillingStatus, BillingTax, BillingTransfer, BillingUser, BillingUserData } from '../../../types/Billing';
import { DimensionType, PricedConsumptionData, PricedDimensionData } from '../../../types/Pricing';
import FeatureToggles, { Feature } from '../../../utils/FeatureToggles';
import StripeHelpers, { StripeChargeOperationResult } from './StripeHelpers';

MODIFY
src/types/Billing.ts
src/types/Billing.ts
@@ -190,15 +190,12 @@ export enum BillingTransferStatus {
TRANSFERRED = 'transferred'
}
+// TODO - TO BE CLARIFIED - REDUNDANT INFORMATION
export interface BillingPlatformFeeData {
feeAmount: number;
feeTaxAmount: number;
}
-export interface BillingAccountSessionFee extends BillingPlatformFeeStrategy {
- feeAmount: number;
-}
-
export interface BillingTransfer extends CreatedUpdatedProps, BillingTransferAuthorizationActions {
id?: string;
status: BillingTransferStatus;
@@ -221,16 +218,6 @@ export interface BillingTransfer extends CreatedUpdatedProps, BillingTransferAut
// Very important - preserve maximal precision - Decimal type is persisted as an object in the DB
export type BillingAmount = Decimal.Value;
-export interface BillingTransferSession {
- transactionID: number;
- invoiceID: string;
- invoiceNumber: string;
- amountAsDecimal: BillingAmount
- amount: number; // ACHTUNG - That one should not include any taxes
- roundedAmount: number;
- accountSessionFee: BillingAccountSessionFee;
-}
-
export interface BillingPlatformInvoice {
invoiceID: string;
liveMode: boolean;

MODIFY
test/factories/BillingFactory.ts
test/factories/BillingFactory.ts
-import { BillingAccountSessionFee, BillingPlatformFeeStrategy, BillingTransfer, BillingTransferSession, BillingTransferStatus } from '../../src/types/Billing';
+import { BillingPlatformFeeStrategy, BillingTransfer, BillingTransferStatus } from '../../src/types/Billing';
import { Factory } from 'rosie';
import faker from 'faker';
@@ -18,20 +18,6 @@ export const BillingTransferFactory = Factory.define<BillingTransfer>('billingtr
feeTaxAmount: 0
}));
-export const BillingTransferSessionFactory = Factory.define<BillingTransferSession>('billingtransfersession')
- .attr('transactionID', () => faker.datatype.number())
- .attr('amount', () => faker.datatype.number())
- .attr('accountSessionFee', () => ({
- flatFeePerSession: 0.5,
- percentage: 3,
- feeAmount: 0
- }));
-
export const BillingPlatformFeeStrategyFactory = Factory.define<BillingPlatformFeeStrategy>('billingplatformfeestrategy')
.attr('flatFeePerSession', () => 0.5)
.attr('percentage', () => 3);
-
-export const BillingPlatformSessionFeeFactory = Factory.define<BillingAccountSessionFee>('billingaccountSessionFee')
- .attr('flatFeePerSession', 0.5)
- .attr('percentage', 3)
- .attr('feeAmount', 0);

bp - cleanup - unused interface removal