{
    "title": "orders with delivery date (volatile part)",
    "$schema": "http://json-schema.org/draft-04/schema#",
    "javaType": "com.sos.joc.model.order.OrdersV",
    "type": "object",
    "required": [
        "deliveryDate",
        "orders"
    ],
    "properties": {
        "deliveryDate": {
            "description": "Value is UTC timestamp in ISO 8601 YYYY-MM-DDThh:mm:ss.sZ or empty",
            "type": "string",
            "format": "date-time"
        },
        "surveyDate": {
            "description": "Value is UTC timestamp in ISO 8601 YYYY-MM-DDThh:mm:ss.sZ or empty",
            "type": "string",
            "format": "date-time"
        },
        "orders": {
            "type": "array",
            "items": {
                "javaType": "com.sos.joc.model.order.OrderV",
                "type": "object",
                "required": [
                    "orderId",
                    "workflowId",
                    "state"
                ],
                "properties": {
                    "deliveryDate": {
                        "description": "Value is UTC timestamp in ISO 8601 YYYY-MM-DDThh:mm:ss.sZ or empty",
                        "type": "string",
                        "format": "date-time"
                    },
                    "surveyDate": {
                        "description": "Value is UTC timestamp in ISO 8601 YYYY-MM-DDThh:mm:ss.sZ or empty",
                        "type": "string",
                        "format": "date-time"
                    },
                    "orderId": {
                        "type": "string",
                        "pattern": "^[^<>]*$",
                        "maxLength": 255
                    },
                    "arguments": {
                        "description": "a map for arbitrary key-value pairs",
                        "javaType": "com.sos.jobscheduler.model.common.Variables",
                        "type": "object",
                        "returnCode": {
                            "type": "integer"
                        },
                        "additionalProperties": {
                            "type": "string"
                        }
                    },
                    "workflowId": {
                        "javaType": "com.sos.jobscheduler.model.workflow.WorkflowId",
                        "type": "object",
                        "required": [
                            "path"
                        ],
                        "properties": {
                            "path": {
                                "description": "absolute path of a JobScheduler object.",
                                "type": "string",
                                "pattern": "^(/|(/[^/\\<>?:\"|*]+)+)$",
                                "maxLength": 255,
                                "minLength": 1
                            },
                            "versionId": {
                                "type": "string",
                                "pattern": "^[^<>]*$",
                                "maxLength": 255
                            }
                        },
                        "additionalProperties": false
                    },
                    "state": {
                        "javaType": "com.sos.joc.model.order.OrderState",
                        "type": "object",
                        "required": [
                            "severity",
                            "_text"
                        ],
                        "properties": {
                            "severity": {
                                "type": "integer"
                            },
                            "_text": {
                                "javaType": "com.sos.joc.model.order.OrderStateText",
                                "type": "string",
                                "enum": [
                                    "PLANNED",
                                    "PENDING",
                                    "RUNNING",
                                    "INPROGRESS",
                                    "SUSPENDED",
                                    "FAILED",
                                    "WAITING",
                                    "BLOCKED",
                                    "CANCELLED",
                                    "FINISHED",
                                    "RESUMED",
                                    "SUSPENDMARKED",
                                    "RESUMEMARKED",
                                    "BROKEN",
                                    "UNKNOWN"
                                ]
                            }
                        }
                    },
                    "attachedState": {
                        "javaType": "com.sos.jobscheduler.model.order.OrderAttachedState",
                        "type": "object",
                        "properties": {
                            "TYPE": {
                                "description": "Attaching, Attached, ...",
                                "type": "string"
                            },
                            "agentName": {
                                "type": "string"
                            }
                        },
                        "additionalProperties": false
                    },
                    "agentId": {
                        "type": "string"
                    },
                    "position": {
                        "description": "Actually, each even item is a string, each odd item is an integer",
                        "type": "array",
                        "items": {
                            "type": "null"
                        }
                    },
                    "scheduledFor": {
                        "type": "number",
                        "format": "utc-millisec",
                        "minimum": 0
                    },
                    "lastOutcome": {
                        "javaType": "com.sos.jobscheduler.model.common.Outcome",
                        "type": "object",
                        "properties": {
                            "required": [
                                "TYPE",
                                "returnCode"
                            ],
                            "TYPE": {
                                "javaType": "com.sos.jobscheduler.model.common.OutcomeType",
                                "type": "string",
                                "enum": [
                                    "Succeeded",
                                    "Failed",
                                    "Disrupted",
                                    "Cancelled"
                                ],
                                "javaEnumNames": [
                                    "Succeeded",
                                    "Failed",
                                    "Disrupted",
                                    "Cancelled"
                                ]
                            },
                            "namedValues": {
                                "description": "a map for arbitrary key-value pairs",
                                "javaType": "com.sos.jobscheduler.model.common.Variables",
                                "type": "object",
                                "returnCode": {
                                    "type": "integer"
                                },
                                "additionalProperties": {
                                    "type": "string"
                                }
                            }
                        },
                        "additionalProperties": false
                    },
                    "historicOutcome": {
                        "description": "only for compact parameter is false",
                        "type": "array",
                        "items": {
                            "type": "object",
                            "javaType": "com.sos.jobscheduler.model.workflow.HistoricOutcome",
                            "properties": {
                                "position": {
                                    "description": "Actually, each even item is a string, each odd item is an integer",
                                    "type": "array",
                                    "items": {
                                        "type": "null"
                                    }
                                },
                                "outcome": {
                                    "javaType": "com.sos.jobscheduler.model.common.Outcome",
                                    "type": "object",
                                    "properties": {
                                        "required": [
                                            "TYPE",
                                            "returnCode"
                                        ],
                                        "TYPE": {
                                            "javaType": "com.sos.jobscheduler.model.common.OutcomeType",
                                            "type": "string",
                                            "enum": [
                                                "Succeeded",
                                                "Failed",
                                                "Disrupted",
                                                "Cancelled"
                                            ],
                                            "javaEnumNames": [
                                                "Succeeded",
                                                "Failed",
                                                "Disrupted",
                                                "Cancelled"
                                            ]
                                        },
                                        "namedValues": {
                                            "description": "a map for arbitrary key-value pairs",
                                            "javaType": "com.sos.jobscheduler.model.common.Variables",
                                            "type": "object",
                                            "returnCode": {
                                                "type": "integer"
                                            },
                                            "additionalProperties": {
                                                "type": "string"
                                            }
                                        }
                                    },
                                    "additionalProperties": false
                                }
                            },
                            "additionalProperties": false
                        }
                    }
                }
            }
        }
    }
}