billing async task - withUser, withChargingStation
MODIFY
src/async-task/tasks/BillTransactionAsyncTask.ts
src/async-task/tasks/BillTransactionAsyncTask.ts
@@ -24,7 +24,7 @@ export default class BillTransactionAsyncTask extends AbstractAsyncTask {
const transactionLock = await LockingHelper.acquireBillTransactionLock(tenant.id, Number(transactionID));
if (transactionLock) {
try {
- const transaction = await TransactionStorage.getTransaction(tenant.id, Number(transactionID));
+ const transaction = await TransactionStorage.getTransaction(tenant.id, Number(transactionID), { withUser: true, withChargingStation: true });
if (!transaction) {
throw new Error(`Unknown Transaction ID '${this.asyncTask.parameters.transactionID}'`);
}

MODIFY
src/storage/mongodb/TransactionStorage.ts
src/storage/mongodb/TransactionStorage.ts
@@ -1095,12 +1095,13 @@ export default class TransactionStorage {
}
public static async getTransaction(tenantID: string, id: number = Constants.UNKNOWN_NUMBER_ID,
- params: { withTag?: boolean; withCar?: boolean; withUser?: boolean } = {}, projectFields?: string[]): Promise<Transaction> {
+ params: { withTag?: boolean; withCar?: boolean; withUser?: boolean, withChargingStation?: boolean } = {}, projectFields?: string[]): Promise<Transaction> {
const transactionsMDB = await TransactionStorage.getTransactions(tenantID, {
transactionIDs: [id],
withTag: params.withTag,
withCar: params.withCar,
withUser: params.withUser,
+ withChargingStation: params.withChargingStation,
}, Constants.DB_PARAMS_SINGLE_RECORD, projectFields);
return transactionsMDB.count === 1 ? transactionsMDB.result[0] : null;
}

billing async task - withUser, withChargingStation