Use proper param naming
MODIFY
src/server/ocpp/services/OCPPService.ts
src/server/ocpp/services/OCPPService.ts
@@ -845,7 +845,7 @@ export default class OCPPService {
private async deleteAllTransactionTxProfile(tenantID: string, transaction: Transaction) {
const chargingProfiles = await ChargingStationStorage.getChargingProfiles(tenantID, {
- chargingStationID: [transaction.chargeBoxID],
+ chargingStationIDs: [transaction.chargeBoxID],
connectorID: transaction.connectorId,
profilePurposeType: ChargingProfilePurposeType.TX_PROFILE,
transactionId: transaction.id

MODIFY
src/server/ocpp/utils/OCPPUtils.ts
src/server/ocpp/utils/OCPPUtils.ts
@@ -1059,7 +1059,7 @@ export default class OCPPUtils {
};
for (const chargingStation of siteArea.chargingStations) {
const chargingProfiles = await ChargingStationStorage.getChargingProfiles(tenantID, {
- chargingStationID: [chargingStation.id],
+ chargingStationIDs: [chargingStation.id],
profilePurposeType: params.profilePurposeType,
transactionId: params.transactionId
}, Constants.DB_PARAMS_MAX_LIMIT);

MODIFY
src/server/rest/service/ChargingStationService.ts
src/server/rest/service/ChargingStationService.ts
@@ -216,7 +216,7 @@ export default class ChargingStationService {
}
// Check Charging Profile
const chargingProfiles = await ChargingStationStorage.getChargingProfiles(req.user.tenantID,
- { chargingStationID: [chargingStation.id], connectorID: 0 },
+ { chargingStationIDs: [chargingStation.id], connectorID: 0 },
Constants.DB_PARAMS_MAX_LIMIT);
const updatedChargingProfiles: ChargingProfile[] = Utils.cloneJSonDocument(chargingProfiles.result) as ChargingProfile[];
for (let index = 0; index < updatedChargingProfiles.length; index++) {
@@ -307,7 +307,7 @@ export default class ChargingStationService {
}
const chargingProfiles = await ChargingStationStorage.getChargingProfiles(req.user.tenantID,
{ search: filteredRequest.Search,
- chargingStationID: filteredRequest.ChargeBoxID ? filteredRequest.ChargeBoxID.split('|') : null,
+ chargingStationIDs: filteredRequest.ChargeBoxID ? filteredRequest.ChargeBoxID.split('|') : null,
connectorID: filteredRequest.ConnectorID,
withChargingStation: filteredRequest.WithChargingStation,
withSiteArea: true },

MODIFY
src/storage/mongodb/ChargingStationStorage.ts
src/storage/mongodb/ChargingStationStorage.ts
@@ -633,7 +633,7 @@ export default class ChargingStationStorage {
public static async getChargingProfiles(tenantID: string,
params: {
- search?: string; chargingStationID?: string[]; connectorID?: number; chargingProfileID?: string;
+ search?: string; chargingStationIDs?: string[]; connectorID?: number; chargingProfileID?: string;
profilePurposeType?: ChargingProfilePurposeType; transactionId?: number; withChargingStation?: boolean; withSiteArea?: boolean;
} = {},
dbParams: DbParams, projectFields?: string[]): Promise<DataResult<ChargingProfile>> {
@@ -658,8 +658,8 @@ export default class ChargingStationStorage {
filters._id = params.chargingProfileID;
} else {
// Charger
- if (params.chargingStationID) {
- filters.chargingStationID = { $in: params.chargingStationID };
+ if (params.chargingStationIDs) {
+ filters.chargingStationID = { $in: params.chargingStationIDs };
}
// Connector
if (params.connectorID) {

Use proper param naming