{
    "title": "dailyPlanItem",
    "id": "schemas/plan/planItem",
    "$schema": "http://json-schema.org/draft-04/schema#",
    "type": "object",
    "javaType": "com.sos.joc.model.plan.PlanItem",
    "oneOf": [
        {
            "required": [
                "surveyDate",
                "jobChain",
                "orderId",
                "plannedStartTime",
                "expectedEndTime",
                "startMode"
            ]
        },
        {
            "required": [
                "surveyDate",
                "job",
                "plannedStartTime",
                "expectedEndTime",
                "startMode"
            ]
        }
    ],
    "properties": {
        "surveyDate": {
            "id": "schemas/common/surveyDate_p",
            "description": "Date of the inventory data. Value is UTC timestamp in ISO 8601 YYYY-MM-DDThh:mm:ss.sZ",
            "type": "string",
            "format": "date-time"
        },
        "job": {
            "id": "schemas/common/path",
            "description": "absolute path based on live folder of a JobScheduler object.",
            "type": "string",
            "pattern": "/([^/]+/)*[^/]+"
        },
        "jobChain": {
            "id": "schemas/common/path",
            "description": "absolute path based on live folder of a JobScheduler object.",
            "type": "string",
            "pattern": "/([^/]+/)*[^/]+"
        },
        "orderId": {
            "type": "string"
        },
        "plannedStartTime": {
            "id": "schemas/common/timestamp",
            "description": "Value is UTC timestamp in ISO 8601 YYYY-MM-DDThh:mm:ss.sZ or empty",
            "type": "string",
            "format": "date-time"
        },
        "expectedEndTime": {
            "id": "schemas/common/timestamp",
            "description": "Value is UTC timestamp in ISO 8601 YYYY-MM-DDThh:mm:ss.sZ or empty",
            "type": "string",
            "format": "date-time"
        },
        "startTime": {
            "id": "schemas/common/timestamp",
            "description": "Value is UTC timestamp in ISO 8601 YYYY-MM-DDThh:mm:ss.sZ or empty",
            "type": "string",
            "format": "date-time"
        },
        "endTime": {
            "id": "schemas/common/timestamp",
            "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": {
            "id": "schemas/common/nonNegativeInteger",
            "type": "integer",
            "minimum": 0
        },
        "error": {
            "id": "schemas/common/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, 2=start_end_repeat",
            "type": "integer",
            "default": 0
        },
        "period": {
            "description": "undefined for startMode=0",
            "required": [
                "begin",
                "end",
                "repeat"
            ],
            "type": "object",
            "properties": {
                "begin": {
                    "id": "schemas/common/timestamp",
                    "description": "Value is UTC timestamp in ISO 8601 YYYY-MM-DDThh:mm:ss.sZ or empty",
                    "type": "string",
                    "format": "date-time"
                },
                "end": {
                    "id": "schemas/common/timestamp",
                    "description": "Value is UTC timestamp in ISO 8601 YYYY-MM-DDThh:mm:ss.sZ or empty",
                    "type": "string",
                    "format": "date-time"
                },
                "repeat": {
                    "id": "schemas/common/nonNegativeLong",
                    "type": "string",
                    "format": "utc-millisec"
                }
            }
        },
        "late": {
            "type": "boolean"
        },
        "state": {
            "id": "schemas/plan/planState",
            "javaType": "com.sos.joc.model.plan.PlanState",
            "type": "object",
            "required": [
                "severity",
                "_text"
            ],
            "properties": {
                "severity": {
                    "description": "0=SUCCESSFUL, 1=INCOMPLETE, 2=FAILED, 4=PLANNED",
                    "type": "integer"
                },
                "_text": {
                    "id": "schemas/plan/planStateText",
                    "javaType": "com.sos.joc.model.plan.PlanStateText",
                    "type": "string",
                    "enum": [
                        "PLANNED",
                        "SUCCESSFUL",
                        "INCOMPLETE",
                        "FAILED"
                    ]
                }
            }
        },
        "auditLogId": {
            "id": "schemas/common/nonNegativeLong",
            "type": "string",
            "format": "utc-millisec"
        }
    }
}