forgot siteIDs filter oupsi
MODIFY
src/storage/mongodb/TransactionStorage.ts
src/storage/mongodb/TransactionStorage.ts
@@ -328,7 +328,7 @@ export default class TransactionStorage {
ocpiSessionID?: string; ocpiAuthorizationID?: string; ocpiSessionDateFrom?: Date; ocpiSessionDateTo?: Date; ocpiCdrDateFrom?: Date; ocpiCdrDateTo?: Date;
ocpiSessionChecked?: boolean; ocpiCdrChecked?: boolean; oicpSessionID?: string; withSite?: boolean; withSiteArea?: boolean; withCompany?: boolean;
statistics?: TransactionStatisticsType; refundStatus?: RefundStatus[]; withTag?: boolean; hasUserID?: boolean; withUser?: boolean; withCar?: boolean;
- transactionsToStop?: boolean;
+ transactionsToStop?: boolean; siteOwnerIDs?: string[];
},
dbParams: DbParams, projectFields?: string[]): Promise<TransactionDataResult> {
const startTime = Logging.traceDatabaseRequestStart();
@@ -357,6 +357,13 @@ export default class TransactionStorage {
}
});
}
+ if (params.siteOwnerIDs) {
+ ownerMatch.$or.push({
+ siteID: {
+ $in: params.siteOwnerIDs.map((siteID) => DatabaseUtils.convertToObjectID(siteID))
+ }
+ });
+ }
// Create Aggregation
const aggregation = [];
// Filter?

forgot siteIDs filter oupsi