implemented search
MODIFY
src/integration/pricing/convergent-charging
src/integration/pricing/convergent-charging
-Subproject commit 9bb1b37c268965d5d20ca3ce9424e4a301984619
+Subproject commit 0c215b3934227dee43c7921784254e6b52139407

MODIFY
src/integration/refund/concur
src/integration/refund/concur
-Subproject commit e6972e0a55a86018340017f29e946c2b58a67775
+Subproject commit 9beebdbfb701a1671b16038ff27a1b83f0424a8a

MODIFY
src/server/rest/service/ChargingStationService.ts
src/server/rest/service/ChargingStationService.ts
@@ -393,11 +393,13 @@ export default class ChargingStationService {
});
}
const chargingProfiles = await ChargingStationStorage.getChargingProfiles(req.user.tenantID,
- { chargingStationIDs: filteredRequest.ChargeBoxID ? filteredRequest.ChargeBoxID.split('|') : null,
+ { search: filteredRequest.Search,
+ chargingStationID: filteredRequest.ChargeBoxID ? filteredRequest.ChargeBoxID.split('|') : null,
connectorID: filteredRequest.ConnectorID,
withChargingStation: filteredRequest.WithChargingStation,
withSiteArea: filteredRequest.WithSiteArea },
{ limit: filteredRequest.Limit, skip: filteredRequest.Skip, sort: filteredRequest.Sort, onlyRecordCount: filteredRequest.OnlyRecordCount });
+
res.json(chargingProfiles);
next();
}

MODIFY
src/storage/mongodb/ChargingStationStorage.ts
src/storage/mongodb/ChargingStationStorage.ts
@@ -699,7 +699,7 @@ export default class ChargingStationStorage {
public static async getChargingProfiles(tenantID: string,
params: {
- chargingStationIDs?: string[]; connectorID?: number; chargingProfileID?: string;
+ search?: string; chargingStationID?: string[] | string; connectorID?: number; chargingProfileID?: string;
profilePurposeType?: ChargingProfilePurposeType; transactionId?: number; withChargingStation?: boolean; withSiteArea?: boolean;
} = {},
dbParams: DbParams, projectFields?: string[]): Promise<DataResult<ChargingProfile>> {
@@ -713,12 +713,19 @@ export default class ChargingStationStorage {
dbParams.skip = Utils.checkRecordSkip(dbParams.skip);
// Query by chargingStationID
const filters: any = {};
+ // Build filter
+ if (params.search) {
+ const searchRegex = Utils.escapeSpecialCharsInRegex(params.search);
+ filters.$or = [
+ { 'chargingStationID': { $regex: searchRegex, $options: 'i' } },
+ ];
+ }
if (params.chargingProfileID) {
filters._id = params.chargingProfileID;
} else {
// Charger
- if (params.chargingStationIDs) {
- filters.chargingStationID = { $in: params.chargingStationIDs };
+ if (params.chargingStationID) {
+ filters.chargingStationID = { $in: params.chargingStationID };
}
// Connector
if (params.connectorID) {

implemented search