extends HTTP Request to OCPP actions
MODIFY
src/server/rest/v1/validator/ChargingStationValidator.ts
src/server/rest/v1/validator/ChargingStationValidator.ts
-import { HttpChargingProfilesRequest, HttpChargingStationChangeAvailabilityRequest, HttpChargingStationChangeConfigurationRequest, HttpChargingStationClearCacheRequest, 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 { 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 { 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): HttpChargingStationClearCacheRequest {
+ public validateChargingStationActionCacheClearReq(data: unknown): HttpChargingStationCommandRequest {
return this.validate('validateChargingStationActionCacheClearReq', this.chargingStationActionCacheClear, data);
}

MODIFY
src/types/requests/HttpChargingStationRequest.ts
src/types/requests/HttpChargingStationRequest.ts
@@ -102,43 +102,32 @@ export interface HttpChargingStationOcppParametersRequest {
forceUpdateOCPPParamsFromTemplate: boolean;
}
-export interface HttpChargingStationSetMaxIntensitySocketRequest {
- chargingStationID: string;
+export interface HttpChargingStationSetMaxIntensitySocketRequest extends HttpChargingStationCommandRequest {
carID?: string;
userID?: string;
maxIntensity?: number;
args?: {maxIntensity: number};
}
-/* export interface HttpChargingStationCommandRequest {
+export interface HttpChargingStationCommandRequest {
chargingStationID: string;
- carID?: string;
- userID?: string;
- args?: any;
-} */
+}
-export interface HttpChargingStationChangeAvailabilityRequest {
- chargingStationID: string,
+export interface HttpChargingStationChangeAvailabilityRequest extends HttpChargingStationCommandRequest {
args: {
connectorId: string,
type: 'Inoperative' | 'Operative';
}
}
-export interface HttpChargingStationChangeConfigurationRequest {
- chargingStationID: string,
+export interface HttpChargingStationChangeConfigurationRequest extends HttpChargingStationCommandRequest {
args: {
key: string,
value: string;
}
}
-export interface HttpChargingStationClearCacheRequest {
- chargingStationID: string
-}
-
-export interface HttpChargingStationCommandDataTransferRequest {
- chargingStationID: string,
+export interface HttpChargingStationCommandDataTransferRequest extends HttpChargingStationCommandRequest {
args: {
vendorId: string,
messageId?: string,
@@ -146,8 +135,7 @@ export interface HttpChargingStationCommandDataTransferRequest {
}
}
-export interface HttpChargingStationStartTransactionRequest {
- chargingStationID: string,
+export interface HttpChargingStationStartTransactionRequest extends HttpChargingStationCommandRequest {
carID?: string,
userID?: string,
args: {
@@ -157,22 +145,19 @@ export interface HttpChargingStationStartTransactionRequest {
}
}
-export interface HttpChargingStationStopTransactionRequest {
- chargingStationID: string,
+export interface HttpChargingStationStopTransactionRequest extends HttpChargingStationCommandRequest {
args: {
transactionID: number
}
}
-export interface HttpChargingStationCommandGetConfigurationRequest {
- chargingStationID: string,
+export interface HttpChargingStationCommandGetConfigurationRequest extends HttpChargingStationCommandRequest {
args: {
key: string[]
}
}
-export interface HttpChargingStationGetCompositeScheduleRequest {
- chargingStationID: string,
+export interface HttpChargingStationGetCompositeScheduleRequest extends HttpChargingStationCommandRequest {
args: {
connectorId: number,
duration: number,
@@ -180,15 +165,13 @@ export interface HttpChargingStationGetCompositeScheduleRequest {
}
}
-export interface HttpChargingStationCommandUnlockConnectorRequest {
- chargingStationID: string,
+export interface HttpChargingStationCommandUnlockConnectorRequest extends HttpChargingStationCommandRequest {
args: {
connectorId: string
}
}
-export interface HttpChargingStationUpdateFirmwareRequest {
- chargingStationID: string,
+export interface HttpChargingStationUpdateFirmwareRequest extends HttpChargingStationCommandRequest {
args: {
location: string,
retries?: number,
@@ -197,8 +180,7 @@ export interface HttpChargingStationUpdateFirmwareRequest {
}
}
-export interface HttpChargingStationReserveNowRequest {
- chargingStationID: string,
+export interface HttpChargingStationReserveNowRequest extends HttpChargingStationCommandRequest {
args: {
connectorId: string;
expiryDate: Date;
@@ -208,8 +190,7 @@ export interface HttpChargingStationReserveNowRequest {
}
}
-export interface HttpChargingStationResetRequest {
- chargingStationID: string,
+export interface HttpChargingStationResetRequest extends HttpChargingStationCommandRequest {
args: {
type: 'Soft' | 'Hard';
}
@@ -226,8 +207,7 @@ export interface HttpChargingStationGetFirmwareRequest {
FileName: string;
}
-export interface HttpChargingStationGetDiagnosticsRequest {
- chargingStationID: string,
+export interface HttpChargingStationGetDiagnosticsRequest extends HttpChargingStationCommandRequest {
args: {
location: string,
retries?: number,

extends HTTP Request to OCPP actions