Refactored charging profile schema structure
MODIFY
src/assets/server/rest/v1/schemas/chargingstation/chargingprofile-create.json
src/assets/server/rest/v1/schemas/chargingstation/chargingprofile-create.json
{
"title": "Create a Charging Profile",
"type": "object",
- "properties": {
- "chargingStationID": {
- "$ref": "chargingstation.json#/definitions/id"
- },
- "connectorID": {
- "$ref": "chargingstation.json#/definitions/connectorID"
- },
- "chargePointID": {
- "type": "number",
- "sanitize": "mongo"
- },
- "profile": {
"$ref": "chargingstation.json#/definitions/chargingProfile"
}
- },
- "required": [
- "chargingStationID", "connectorID", "chargePointID", "profile"
- ]
-}

MODIFY
src/assets/server/rest/v1/schemas/chargingstation/chargingstation-action.json
src/assets/server/rest/v1/schemas/chargingstation/chargingstation-action.json
"$ref": "chargingstation.json#/definitions/chargingProfilePurpose"
},
"stackLevel": {
- "$ref": "chargingstation.json#/definitions/stackLevel"
+ "$ref": "chargingstation.json#/definitions/chargingProfile/properties/profile/properties/stackLevel"
},
"tagID": {
"$ref": "tag.json#/definitions/id"

MODIFY
src/assets/server/rest/v1/schemas/chargingstation/chargingstation.json
src/assets/server/rest/v1/schemas/chargingstation/chargingstation.json
"sanitize": "mongo"
},
"chargingProfile": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "$ref": "common.json#/definitions/id"
+ },
+ "chargingStationID": {
+ "$ref": "chargingstation.json#/definitions/id"
+ },
+ "connectorID": {
+ "$ref": "chargingstation.json#/definitions/connectorID"
+ },
+ "chargePointID": {
+ "type": "number",
+ "sanitize": "mongo"
+ },
+ "profile": {
+ "$ref": "#/definitions/profile"
+ }
+ },
+ "required": [
+ "chargingStationID",
+ "profile"
+ ]
+ },
+ "profile": {
"type": "object",
"properties": {
"chargingProfileId": {
"$ref": "transaction.json#/definitions/id"
},
"stackLevel": {
- "$ref": "#/definitions/stackLevel"
+ "type": "number",
+ "sanitize": "mongo"
},
"chargingProfilePurpose": {
- "$ref": "#/definitions/chargingProfilePurpose"
+ "type": "string",
+ "sanitize": "mongo"
},
"chargingProfileKind": {
"type": "string",
"chargingSchedule": {
"$ref": "#/definitions/chargingSchedule"
}
- }
+ },
+ "required": [
+ "chargingProfileId",
+ "stackLevel",
+ "chargingProfilePurpose",
+ "chargingProfileKind",
+ "chargingSchedule"
+ ]
},
"chargingSchedule": {
"type": "object",
"sanitize": "mongo"
},
"chargingSchedulePeriod": {
+ "type": "array",
+ "items": {
"$ref": "#/definitions/chargingSchedulePeriod"
+ }
},
"minChargeRate": {
"type": "number",
]
},
"chargingSchedulePeriod": {
- "type": "array",
- "items": {
+ "type": "object",
"properties": {
"startPeriod": {
"type": "number",
"type": "number",
"sanitize": "mongo"
}
- }
},
"required": [
"startPeriod",
"type": "string",
"pattern": "^(\\d\\|?)*$",
"sanitize": "mongo"
- },
- "chargingProfilePurpose": {
- "type": "string",
- "sanitize": "mongo"
- },
- "stackLevel": {
- "type": "number",
- "sanitize": "mongo"
}
}
}

Refactored charging profile schema structure