{
    "title": "history collection of orders",
    "$schema": "http://json-schema.org/draft-04/schema#",
    "description": "one item per started order",
    "javaType": "com.sos.joc.model.order.OrderHistory",
    "type": "object",
    "required": [
        "deliveryDate",
        "history"
    ],
    "properties": {
        "deliveryDate": {
            "description": "Current date of the JOC server/REST service. Value is UTC timestamp in ISO 8601 YYYY-MM-DDThh:mm:ss.sZ",
            "type": "string",
            "format": "date-time"
        },
        "history": {
            "type": "array",
            "items": {
                "javaType": "com.sos.joc.model.order.OrderHistoryItem",
                "type": "object",
                "required": [
                    "surveyDate",
                    "path",
                    "orderId",
                    "jobChain",
                    "startTime",
                    "node",
                    "state",
                    "historyId"
                ],
                "properties": {
                    "surveyDate": {
                        "description": "Date of the inventory data. Value is UTC timestamp in ISO 8601 YYYY-MM-DDThh:mm:ss.sZ",
                        "type": "string",
                        "format": "date-time"
                    },
                    "jobschedulerId": {
                        "type": "string"
                    },
                    "path": {
                        "description": "absolute path based on live folder of a JobScheduler object.",
                        "type": "string",
                        "pattern": "^(/|(/[^/\\<>?:\"|*]+)+)$",
                        "maxLength": 255
                    },
                    "orderId": {
                        "type": "string"
                    },
                    "jobChain": {
                        "description": "absolute path based on live folder of a JobScheduler object.",
                        "type": "string",
                        "pattern": "^(/|(/[^/\\<>?:\"|*]+)+)$",
                        "maxLength": 255
                    },
                    "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"
                    },
                    "node": {
                        "type": "string"
                    },
                    "state": {
                        "javaType": "com.sos.joc.model.common.HistoryState",
                        "type": "object",
                        "required": [
                            "severity",
                            "_text"
                        ],
                        "properties": {
                            "severity": {
                                "description": "0=successful, 1=incomplete, 2=failed with a green/yellow/red representation",
                                "type": "integer"
                            },
                            "_text": {
                                "javaType": "com.sos.joc.model.common.HistoryStateText",
                                "type": "string",
                                "enum": [
                                    "SUCCESSFUL",
                                    "INCOMPLETE",
                                    "FAILED"
                                ]
                            }
                        }
                    },
                    "historyId": {
                        "type": "string"
                    },
                    "children": {
                        "type": "array",
                        "items": {
                            "description": "historyItem-schema.json"
                        }
                    }
                }
            }
        }
    }
}