Fixed user got notified when stopped transaction with his badge
MODIFY
src/start.ts
src/start.ts
+import cluster from 'cluster';
+import MigrationHandler from './migration/MigrationHandler';
+import SchedulerManager from './scheduler/SchedulerManager';
+import OCPIServer from './server/ocpi/OCPIServer';
+import JsonCentralSystemServer from './server/ocpp/json/JsonCentralSystemServer';
+import SoapCentralSystemServer from './server/ocpp/soap/SoapCentralSystemServer';
+import ODataServer from './server/odata/ODataServer';
import CentralRestServer from './server/rest/CentralRestServer';
+import MongoDBStorage from './storage/mongodb/MongoDBStorage';
+import MongoDBStorageNotification from './storage/mongodb/MongoDBStorageNotification';
+import TransactionStorage from './storage/mongodb/TransactionStorage';
import CentralSystemConfiguration from './types/configuration/CentralSystemConfiguration';
import CentralSystemRestServiceConfiguration from './types/configuration/CentralSystemRestServiceConfiguration';
import ChargingStationConfiguration from './types/configuration/ChargingStationConfiguration';
-import Configuration from './utils/Configuration';
-import Constants from './utils/Constants';
-import I18nManager from './utils/I18nManager';
-import JsonCentralSystemServer from './server/ocpp/json/JsonCentralSystemServer';
-import Logging from './utils/Logging';
import MigrationConfiguration from './types/configuration/MigrationConfiguration';
-import MigrationHandler from './migration/MigrationHandler';
-import MongoDBStorage from './storage/mongodb/MongoDBStorage';
-import MongoDBStorageNotification from './storage/mongodb/MongoDBStorageNotification';
-import OCPIServer from './server/ocpi/OCPIServer';
import OCPIServiceConfiguration from './types/configuration/OCPIServiceConfiguration';
-import OCPPUtils from './server/ocpp/utils/OCPPUtils';
-import ODataServer from './server/odata/ODataServer';
import ODataServiceConfiguration from './types/configuration/ODataServiceConfiguration';
-import SchedulerManager from './scheduler/SchedulerManager';
-import { ServerAction } from './types/Server';
-import SoapCentralSystemServer from './server/ocpp/soap/SoapCentralSystemServer';
import StorageConfiguration from './types/configuration/StorageConfiguration';
-import Utils from './utils/Utils';
-import cluster from 'cluster';
import global from './types/GlobalType';
+import { ServerAction } from './types/Server';
+import Configuration from './utils/Configuration';
+import Constants from './utils/Constants';
+import I18nManager from './utils/I18nManager';
+import Logging from './utils/Logging';
+import Utils from './utils/Utils';
const MODULE_NAME = 'Bootstrap';

MODIFY
src/storage/mongodb/TransactionStorage.ts
src/storage/mongodb/TransactionStorage.ts
@@ -1136,11 +1136,22 @@ export default class TransactionStorage {
let: { tagID: '$_id', dateStart: '$dateStart', dateEnd: '$dateEnd' },
pipeline: [{
$match: {
+ $or: [
+ {
$and: [
{ $expr: { $eq: ['$tagID', '$$tagID'] } },
{ $expr: { $gt: ['$timestamp', '$$dateStart'] } },
{ $expr: { $lt: ['$timestamp', '$$dateEnd'] } }
]
+ },
+ {
+ $and: [
+ { $expr: { $eq: ['$stop.tagID', '$$tagID'] } },
+ { $expr: { $gt: ['$stop.timestamp', '$$dateStart'] } },
+ { $expr: { $lt: ['$stop.timestamp', '$$dateEnd'] } }
+ ]
+ },
+ ]
}
}],
as: 'transaction'

Fixed user got notified when stopped transaction with his badge