Improved CP responses in doc
MODIFY
src/assets/server/rest/v1/docs/e-mobility-oas.json
src/assets/server/rest/v1/docs/e-mobility-oas.json
"description": "Return profiles list",
"content": {
"application/json": {
- "schema": {
- "type": "object",
- "properties": {
- "count": {
- "type": "integer"
+ "example": {
+ "count": 1,
+ "result": [
+ {
+ "chargePointID": 1,
+ "chargingStationID": "###",
+ "connectorID": 1,
+ "profile": {
+ "chargingProfileId": 1,
+ "chargingProfileKind": "###",
+ "chargingProfilePurpose": "###",
+ "transactionId": 123456789,
+ "stackLevel": 2,
+ "chargingSchedule": {
+ "chargingRateUnit": "A",
+ "chargingSchedulePeriod": [
+ {
+ "startPeriod": 0,
+ "limit": 96
},
- "result": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/ChargingProfile"
+ {
+ "startPeriod": 900,
+ "limit": 96
+ },
+ {
+ "startPeriod": 1800,
+ "limit": 96
+ },
+ {
+ "startPeriod": 2700,
+ "limit": 96
+ },
+ {
+ "startPeriod": 3600,
+ "limit": 96
+ },
+ {
+ "startPeriod": 4500,
+ "limit": 96
+ },
+ {
+ "startPeriod": 5400,
+ "limit": 96
+ },
+ {
+ "startPeriod": 6300,
+ "limit": 96
+ },
+ {
+ "startPeriod": 7200,
+ "limit": 96
+ },
+ {
+ "startPeriod": 8100,
+ "limit": 96
+ },
+ {
+ "startPeriod": 9000,
+ "limit": 96
+ },
+ {
+ "startPeriod": 9900,
+ "limit": 96
+ },
+ {
+ "startPeriod": 10800,
+ "limit": 96
+ },
+ {
+ "startPeriod": 11700,
+ "limit": 96
+ },
+ {
+ "startPeriod": 12600,
+ "limit": 96
+ },
+ {
+ "startPeriod": 13500,
+ "limit": 96
+ },
+ {
+ "startPeriod": 14400,
+ "limit": 96
+ },
+ {
+ "startPeriod": 15300,
+ "limit": 96
+ },
+ {
+ "startPeriod": 16200,
+ "limit": 96
+ },
+ {
+ "startPeriod": 17100,
+ "limit": 96
+ },
+ {
+ "startPeriod": 18000,
+ "limit": 96
+ },
+ {
+ "startPeriod": 18900,
+ "limit": 79.209
}
+ ],
+ "startSchedule": "2021-04-06T07:30:00.000Z",
+ "duration": 19800
}
+ },
+ "chargingStation": {
+ "id": "###",
+ "siteArea": {
+ "id": "###",
+ "name": "###",
+ "maximumPower": "###"
}
+ },
+ "id": "###"
+ }
+ ]
}
}
}

MODIFY
src/assets/server/rest/v1/schemas/chargingstation/chargingprofiles-get.json
src/assets/server/rest/v1/schemas/chargingstation/chargingprofiles-get.json
"$ref": "common.json#/definitions/search"
},
"ChargingStationID": {
- "$ref": "chargingstation.json#/definitions/id"
+ "$ref": "chargingstation.json#/definitions/ids"
},
"ConnectorID": {
"$ref": "chargingstation.json#/definitions/connector/properties/connectorId"

MODIFY
src/server/rest/v1/validator/ChargingStationValidator.ts
src/server/rest/v1/validator/ChargingStationValidator.ts
-import { HttpChargingProfilesRequest, HttpChargingProfilesUpdateRequest, HttpChargingStationCommandRequest, HttpChargingStationConnectorRequest, HttpChargingStationGetFirmwareRequest, HttpChargingStationLimitPowerRequest, HttpChargingStationOcppParametersRequest, HttpChargingStationOcppRequest, HttpChargingStationParamsUpdateRequest, HttpChargingStationRequest, HttpChargingStationsInErrorRequest, HttpChargingStationsRequest, HttpDownloadQrCodeRequest, HttpTriggerSmartChargingRequest } from '../../../../types/requests/HttpChargingStationRequest';
+import { HttpChargingProfilesRequest, HttpChargingStationCommandRequest, HttpChargingStationConnectorRequest, HttpChargingStationGetFirmwareRequest, HttpChargingStationLimitPowerRequest, HttpChargingStationOcppParametersRequest, HttpChargingStationOcppRequest, HttpChargingStationParamsUpdateRequest, HttpChargingStationRequest, HttpChargingStationsInErrorRequest, HttpChargingStationsRequest, HttpDownloadQrCodeRequest, HttpTriggerSmartChargingRequest } from '../../../../types/requests/HttpChargingStationRequest';
import { ChargingProfile } from '../../../../types/ChargingProfile';
import HttpByIDRequest from '../../../../types/requests/HttpByIDRequest';
@@ -104,13 +104,6 @@ export default class ChargingStationValidator extends SchemaValidator {
return data;
}
-
- public validateChargingProfileCreateReq(data: ChargingProfile): ChargingProfile {
- // Validate schema
- this.validate(this.chargingProfileCreate, data);
- return data;
- }
-
public validateChargingStationRequestOCPPParametersReq(data: any): HttpChargingStationOcppParametersRequest {
// Validate schema
this.validate(this.chargingStationRequestOCPPParameters, data);
@@ -153,6 +146,12 @@ export default class ChargingStationValidator extends SchemaValidator {
return data;
}
+ public validateChargingProfileCreateReq(data: ChargingProfile): ChargingProfile {
+ // Validate schema
+ this.validate(this.chargingProfileCreate, data);
+ return data;
+ }
+
public validateChargingProfileDeleteReq(data: any): HttpByIDRequest {
// Validate schema
this.validate(this.chargingProfileDelete, data);

Improved CP responses in doc