Reuse cp scheme and usage of enums
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/connector/properties/connectorId"
- },
- "chargePointID": {
- "type": "number",
- "sanitize": "mongo"
- },
- "profile": {
- "type": "object",
- "properties": {
- "chargingProfileId": {
- "type": "number",
- "sanitize": "mongo"
- },
- "transactionId": {
- "$ref": "transaction.json#/definitions/id"
- },
- "stackLevel": {
- "type": "number",
- "sanitize": "mongo"
- },
- "chargingProfilePurpose": {
- "type": "string",
- "sanitize": "mongo"
- },
- "chargingProfileKind": {
- "type": "string",
- "sanitize": "mongo"
- },
- "recurrencyKind": {
- "type": "string",
- "sanitize": "mongo"
- },
- "validFrom": {
- "type": "string",
- "format": "date-time",
- "sanitize": "mongo"
- },
- "validTo": {
- "type": "string",
- "format": "date-time",
- "sanitize": "mongo"
- },
- "chargingSchedule": {
- "type": "object",
- "properties": {
- "duration": {
- "type": "number",
- "sanitize": "mongo"
- },
- "startSchedule": {
- "type": "string",
- "format": "date-time",
- "sanitize": "mongo"
- },
- "chargingRateUnit": {
- "type": "string",
- "sanitize": "mongo"
- },
- "chargingSchedulePeriod": {
- "type": "array",
- "items": {
- "type": "object",
- "properties": {
- "startPeriod": {
- "type": "number",
- "sanitize": "mongo"
- },
- "limit": {
- "type": "number",
- "sanitize": "mongo"
- },
- "numberPhases": {
- "type": "number",
- "sanitize": "mongo"
- }
- },
- "required": [
- "startPeriod",
- "limit"
- ]
- }
- },
- "minChargeRate": {
- "type": "number",
- "sanitize": "mongo"
- }
- },
- "required": [
- "chargingRateUnit",
- "chargingSchedulePeriod"
- ]
- }
- },
- "required": [
- "chargingProfileId",
- "stackLevel",
- "chargingProfilePurpose",
- "chargingProfileKind",
- "chargingSchedule"
- ]
- }
- },
- "required": [
- "chargingStationID",
- "profile"
- ]
+ "$ref": "chargingstation.json#/definitions/chargingProfile"
}

MODIFY
src/assets/server/rest/v1/schemas/chargingstation/chargingprofile-update.json
src/assets/server/rest/v1/schemas/chargingstation/chargingprofile-update.json
{
"title": "Update a Charging Profile",
- "type": "object",
"$ref": "chargingstation.json#/definitions/chargingProfile"
}

MODIFY
src/assets/server/rest/v1/schemas/chargingstation/chargingstation.json
src/assets/server/rest/v1/schemas/chargingstation/chargingstation.json
"$ref": "#/definitions/connector/properties/connectorId"
},
"chargePointID": {
- "type": "number",
- "sanitize": "mongo"
+ "$ref": "#/definitions/chargePoint/properties/chargePointID"
},
"profile": {
"type": "object",
},
"chargingProfilePurpose": {
"type": "string",
- "sanitize": "mongo"
+ "sanitize": "mongo",
+ "enum": [
+ "ChargePointMaxProfile",
+ "TxDefaultProfile",
+ "TxProfile"
+ ]
},
"chargingProfileKind": {
"type": "string",
- "sanitize": "mongo"
+ "sanitize": "mongo",
+ "enum": [
+ "Absolute",
+ "Recurring",
+ "Relative"
+ ]
},
"recurrencyKind": {
"type": "string",
- "sanitize": "mongo"
+ "sanitize": "mongo",
+ "enum": [
+ "Daily",
+ "Weekly"
+ ]
},
"validFrom": {
"type": "string",
},
"chargingRateUnit": {
"type": "string",
- "sanitize": "mongo"
+ "sanitize": "mongo",
+ "enum": [
+ "W",
+ "A"
+ ]
},
"chargingSchedulePeriod": {
"type": "array",
}
},
"required": [
- "id",
"chargingStationID",
"profile"
]

Reuse cp scheme and usage of enums