reviewed with Serge
MODIFY
src/assets/server/rest/v1/docs/e-mobility-oas.json
src/assets/server/rest/v1/docs/e-mobility-oas.json
"type": "string",
"description": "Required. Value to set",
"example": ""
+ },
+ "custom": {
+ "type": "boolean",
+ "description": "Custom OCPP parameter",
+ "example": true
}
}
}

MODIFY
src/assets/server/rest/v1/schemas/chargingstation/chargingstation-action-configuration-change.json
src/assets/server/rest/v1/schemas/chargingstation/chargingstation-action-configuration-change.json
"type": "string",
"sanitize": "mongo",
"maxLength": 500
+ },
+ "custom": {
+ "type": "boolean",
+ "sanitize": "mongo"
}
},
"required": [

MODIFY
src/server/ocpp/utils/OCPPUtils.ts
src/server/ocpp/utils/OCPPUtils.ts
@@ -1629,7 +1629,7 @@ export default class OCPPUtils {
source: ocppHeader.chargeBoxIdentity,
module: MODULE_NAME,
method: 'checkAndGetTenantAndChargingStation',
- message: 'Cannot aquire a lock on the Charging Station'
+ message: 'Cannot acquire a lock on the Charging Station'
});
}
// Get the Charging Station

MODIFY
src/server/rest/v1/service/ChargingStationService.ts
src/server/rest/v1/service/ChargingStationService.ts
import { Action, Entity } from '../../../../types/Authorization';
-import ChargingStation, { ChargingStationOcppParameters, ChargingStationQRCode, Command, OCPPParams, StaticLimitAmps } from '../../../../types/ChargingStation';
+import ChargingStation, { ChargingStationOcppParameters, ChargingStationQRCode, Command, OCPPParams, OcppParameter, StaticLimitAmps } from '../../../../types/ChargingStation';
import { HTTPAuthError, HTTPError } from '../../../../types/HTTPError';
import { HttpChargingStationChangeConfigurationRequest, HttpChargingStationGetCompositeScheduleRequest, HttpChargingStationStartTransactionRequest, HttpChargingStationStopTransactionRequest } from '../../../../types/requests/HttpChargingStationRequest';
import { NextFunction, Request, Response } from 'express';
@@ -1908,7 +1908,7 @@ export default class ChargingStationService {
}
} else {
// Add custom param
- chargingStationOcppParameters.configuration.push(filteredRequest.args);
+ chargingStationOcppParameters.configuration.push(filteredRequest.args as OcppParameter);
// Save
await ChargingStationStorage.saveOcppParameters(req.tenant, chargingStationOcppParameters);
}

MODIFY
src/server/rest/v1/validator/ChargingStationValidator.ts
src/server/rest/v1/validator/ChargingStationValidator.ts
-import { HttpChargingProfilesRequest, HttpChargingStationChangeAvailabilityRequest, HttpChargingStationChangeConfigurationRequest, HttpChargingStationCommandDataTransferRequest, HttpChargingStationCommandGetConfigurationRequest, HttpChargingStationCommandRequest, HttpChargingStationCommandUnlockConnectorRequest, HttpChargingStationConnectorRequest, HttpChargingStationGetCompositeScheduleRequest, HttpChargingStationGetDiagnosticsRequest, HttpChargingStationGetFirmwareRequest, HttpChargingStationLimitPowerRequest, HttpChargingStationOcppParametersRequest, HttpChargingStationOcppRequest, HttpChargingStationParamsUpdateRequest, HttpChargingStationRequest, HttpChargingStationReserveNowRequest, HttpChargingStationResetRequest, HttpChargingStationStartTransactionRequest, HttpChargingStationStopTransactionRequest, HttpChargingStationUpdateFirmwareRequest, HttpChargingStationsInErrorRequest, HttpChargingStationsRequest, HttpDownloadQrCodeRequest, HttpTriggerSmartChargingRequest } from '../../../../types/requests/HttpChargingStationRequest';
+import { HttpChargingProfilesRequest, HttpChargingStationCacheClearCommandRequest, HttpChargingStationChangeAvailabilityRequest, HttpChargingStationChangeConfigurationRequest, HttpChargingStationCommandDataTransferRequest, HttpChargingStationCommandGetConfigurationRequest, HttpChargingStationCommandUnlockConnectorRequest, HttpChargingStationConnectorRequest, HttpChargingStationGetCompositeScheduleRequest, HttpChargingStationGetDiagnosticsRequest, HttpChargingStationGetFirmwareRequest, HttpChargingStationLimitPowerRequest, HttpChargingStationOcppParametersRequest, HttpChargingStationOcppRequest, HttpChargingStationParamsUpdateRequest, HttpChargingStationRequest, HttpChargingStationReserveNowRequest, HttpChargingStationResetRequest, HttpChargingStationStartTransactionRequest, HttpChargingStationStopTransactionRequest, HttpChargingStationUpdateFirmwareRequest, HttpChargingStationsInErrorRequest, HttpChargingStationsRequest, HttpDownloadQrCodeRequest, HttpTriggerSmartChargingRequest } from '../../../../types/requests/HttpChargingStationRequest';
import { ChargingProfile } from '../../../../types/ChargingProfile';
import { ChargingStationTemplate } from '../../../../types/ChargingStation';
@@ -112,7 +112,7 @@ export default class ChargingStationValidator extends SchemaValidator {
return this.validate('validateChargingStationActionDataTransferReq', this.chargingStationActionDataTransfer, data);
}
- public validateChargingStationActionCacheClearReq(data: unknown): HttpChargingStationCommandRequest {
+ public validateChargingStationActionCacheClearReq(data: unknown): HttpChargingStationCacheClearCommandRequest {
return this.validate('validateChargingStationActionCacheClearReq', this.chargingStationActionCacheClear, data);
}

MODIFY
src/types/requests/HttpChargingStationRequest.ts
src/types/requests/HttpChargingStationRequest.ts
@@ -113,6 +113,8 @@ export interface HttpChargingStationCommandRequest {
chargingStationID: string;
}
+export type HttpChargingStationCacheClearCommandRequest = HttpChargingStationCommandRequest;
+
export interface HttpChargingStationChangeAvailabilityRequest extends HttpChargingStationCommandRequest {
args: {
connectorId: string,
@@ -124,6 +126,7 @@ export interface HttpChargingStationChangeConfigurationRequest extends HttpCharg
args: {
key: string,
value: string,
+ custom?: boolean,
}
}

reviewed with Serge