{
    "title": "Planned Orders",
    "$schema": "http://json-schema.org/draft-04/schema#",
    "javaType": "com.sos.joc.model.dailyplan.PlannedOrders",
    "type": "object",
    "required": [
        "deliveryDate",
        "plannedOrderItems"
    ],
    "properties": {
        "deliveryDate": {
            "description": "Value is UTC timestamp in ISO 8601 YYYY-MM-DDThh:mm:ss.sZ or empty",
            "type": "string",
            "format": "date-time"
        },
        "plannedOrderItems": {
            "type": "array",
            "items": {
                "type": "object",
                "javaType": "com.sos.joc.model.dailyplan.PlannedOrderItem",
                "required": [
                    "surveyDate",
                    "workflowPath",
                    "orderId",
                    "plannedStartTime",
                    "expectedEndTime",
                    "startMode"
                ],
                "properties": {
                    "controllerId": {
                        "type": "string",
                        "pattern": "^[^/\\<>?:\"|*]*$",
                        "maxLength": 100
                    },
                    "surveyDate": {
                        "description": "Value is UTC timestamp in ISO 8601 YYYY-MM-DDThh:mm:ss.sZ or empty",
                        "type": "string",
                        "format": "date-time"
                    },
                    "workflowPath": {
                        "type": "string",
                        "pattern": "^[^<>]*$",
                        "maxLength": 255
                    },
                    "schedulePath": {
                        "type": "string",
                        "pattern": "^[^<>]*$",
                        "maxLength": 255
                    },
                    "orderId": {
                        "type": "string",
                        "pattern": "^[^<>]*$",
                        "maxLength": 255
                    },
                    "cyclicOrder": {
                        "type": "object",
                        "javaType": "com.sos.joc.model.dailyplan.CyclicOrderInfos",
                        "properties": {
                            "count": {
                                "type": "integer",
                                "minimum": 0
                            },
                            "firstOrderId": {
                                "type": "string",
                                "pattern": "^[^<>]*$",
                                "maxLength": 255
                            },
                            "lastOrderId": {
                                "type": "string",
                                "pattern": "^[^<>]*$",
                                "maxLength": 255
                            },
                            "firstStart": {
                                "description": "Value is UTC timestamp in ISO 8601 YYYY-MM-DDThh:mm:ss.sZ or empty",
                                "type": "string",
                                "format": "date-time"
                            },
                            "lastStart": {
                                "description": "Value is UTC timestamp in ISO 8601 YYYY-MM-DDThh:mm:ss.sZ or empty",
                                "type": "string",
                                "format": "date-time"
                            }
                        }
                    },
                    "plannedStartTime": {
                        "description": "Value is UTC timestamp in ISO 8601 YYYY-MM-DDThh:mm:ss.sZ or empty",
                        "type": "string",
                        "format": "date-time"
                    },
                    "expectedEndTime": {
                        "description": "Value is UTC timestamp in ISO 8601 YYYY-MM-DDThh:mm:ss.sZ or empty",
                        "type": "string",
                        "format": "date-time"
                    },
                    "startTime": {
                        "description": "Value is UTC timestamp in ISO 8601 YYYY-MM-DDThh:mm:ss.sZ or empty",
                        "type": "string",
                        "format": "date-time"
                    },
                    "endTime": {
                        "description": "Value is UTC timestamp in ISO 8601 YYYY-MM-DDThh:mm:ss.sZ or empty",
                        "type": "string",
                        "format": "date-time"
                    },
                    "historyId": {
                        "type": "string"
                    },
                    "node": {
                        "description": "only for orders",
                        "type": "string"
                    },
                    "exitCode": {
                        "type": "integer",
                        "minimum": 0
                    },
                    "error": {
                        "javaType": "com.sos.joc.model.common.Err",
                        "type": "object",
                        "required": [
                            "code",
                            "message"
                        ],
                        "properties": {
                            "code": {
                                "type": "string"
                            },
                            "message": {
                                "type": "string"
                            }
                        }
                    },
                    "startMode": {
                        "description": "0=single_start, 1=start_start_repeat",
                        "type": "integer",
                        "default": 0
                    },
                    "period": {
                        "description": "undefined for startMode=0",
                        "required": [
                            "begin",
                            "end",
                            "repeat"
                        ],
                        "type": "object",
                        "properties": {
                            "begin": {
                                "description": "Value is UTC timestamp in ISO 8601 YYYY-MM-DDThh:mm:ss.sZ or empty",
                                "type": "string",
                                "format": "date-time"
                            },
                            "end": {
                                "description": "Value is UTC timestamp in ISO 8601 YYYY-MM-DDThh:mm:ss.sZ or empty",
                                "type": "string",
                                "format": "date-time"
                            },
                            "repeat": {
                                "type": "number",
                                "format": "utc-millisec",
                                "minimum": 0
                            }
                        }
                    },
                    "late": {
                        "type": "boolean"
                    },
                    "submitted": {
                        "type": "boolean"
                    },
                    "state": {
                        "javaType": "com.sos.joc.model.dailyplan.DailyPlanOrderState",
                        "type": "object",
                        "required": [
                            "severity",
                            "_text"
                        ],
                        "properties": {
                            "severity": {
                                "type": "integer"
                            },
                            "_text": {
                                "javaType": "com.sos.joc.model.dailyplan.DailyPlanOrderStateText",
                                "type": "string",
                                "enum": [
                                    "PLANNED",
                                    "SUBMITTED",
                                    "FINISHED"
                                ]
                            }
                        }
                    }
                }
            }
        }
    }
}