{
    "type": "object",
    "properties": {
        "id": {
            "type": "string"
        },
        "timeCreated": {
            "type": "integer"
        },
        "timeLastModified": {
            "type": "integer"
        },
        "organization": {
            "type": "string"
        },
        "shortId": {
            "type": "string"
        },
        "orderShortId": {
            "type": "null"
        },
        "trackingURL": {
            "type": "string"
        },
        "worker": {
            "type": "string"
        },
        "merchant": {
            "type": "string"
        },
        "executor": {
            "type": "string"
        },
        "creator": {
            "type": "string"
        },
        "dependencies": {
            "type": "array",
            "items": {
                "type": "string"
            }
        },
        "state": {
            "type": "integer"
        },
        "pickupTask": {
            "type": "boolean"
        },
        "type": {
            "type": "integer"
        },
        "notes": {
            "type": "string"
        },
        "completionDetails": {
            "type": "object",
            "properties": {
                "success": {
                    "type": "boolean"
                },
                "notes": {
                    "type": "string"
                },
                "events": {
                    "type": "array",
                    "items": {
                        "type": "object",
                        "properties": {
                            "name": {
                                "type": "string"
                            },
                            "time": {
                                "type": "integer"
                            },
                            "location": {
                                "type": "array",
                                "items": {
                                    "type": "number"
                                }
                            }
                        },
                        "required": [
                            "name",
                            "time"
                        ]
                    }
                },
                "failureNotes": {
                    "type": "string"
                },
                "successNotes": {
                    "type": "string"
                },
                "failureReason": {
                    "type": "string"
                },
                "actions": {
                    "type": "array",
                    "items": {
                        "type": "object",
                        "properties": {
                            "createdAt": {
                                "type": "string"
                            },
                            "actionType": {
                                "type": "string"
                            },
                            "adminId": {
                                "type": "string"
                            },
                            "prevState": {
                                "type": "object",
                                "properties": {
                                    "success": {
                                        "type": "boolean"
                                    },
                                    "notes": {
                                        "type": "string"
                                    },
                                    "failureNotes": {
                                        "type": "string"
                                    },
                                    "successNotes": {
                                        "type": "string"
                                    }
                                },
                                "required": [
                                    "success",
                                    "notes",
                                    "failureNotes",
                                    "successNotes"
                                ]
                            }
                        },
                        "required": [
                            "createdAt",
                            "actionType",
                            "adminId",
                            "prevState"
                        ]
                    }
                },
                "firstLocation": {
                    "type": "array",
                    "items": {
                        "type": "number"
                    }
                },
                "lastLocation": {
                    "type": "array",
                    "items": {
                        "type": "number"
                    }
                }
            },
            "required": [
                "time",
                "events",
                "failureNotes",
                "successNotes",
                "failureReason",
                "actions",
                "signatureUploadId",
                "photoUploadId",
                "photoUploadIds",
                "firstLocation",
                "lastLocation",
                "unavailableAttachments"
            ]
        },
        "feedback": {
            "type": "array",
            "items": {
                "type": "object",
                "properties": {
                    "comments": {
                        "type": "string"
                    },
                    "time": {
                        "type": "string"
                    },
                    "recipient": {
                        "type": "string"
                    },
                    "rating": {
                        "type": "integer"
                    }
                },
                "required": [
                    "comments",
                    "time",
                    "recipient",
                    "rating"
                ]
            }
        },
        "additionalQuantities": {
            "type": "object",
            "properties": {
                "quantityA": {
                    "type": "integer"
                },
                "quantityB": {
                    "type": "integer"
                },
                "quantityC": {
                    "type": "integer"
                }
            },
            "required": [
                "quantityA",
                "quantityB",
                "quantityC"
            ]
        },
        "serviceTime": {
            "type": "integer"
        },
        "identity": {
            "type": "object",
            "properties": {
                "failedScanCount": {
                    "type": "integer"
                },
                "checksum": {
                    "type": "null"
                }
            },
            "required": [
                "failedScanCount",
                "checksum"
            ]
        },
        "appearance": {
            "type": "object",
            "properties": {
                "triangleColor": {
                    "type": "null"
                }
            },
            "required": [
                "triangleColor"
            ]
        },
        "scanOnlyRequiredBarcodes": {
            "type": "boolean"
        },
        "trackingViewed": {
            "type": "boolean"
        },
        "estimatedCompletionTime": {
            "type": "null"
        },
        "estimatedArrivalTime": {
            "type": "null"
        },
        "eta": {
            "type": "null"
        },
        "recipients": {
            "type": "array",
            "items": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "string"
                    },
                    "timeCreated": {
                        "type": "integer"
                    },
                    "timeLastModified": {
                        "type": "integer"
                    },
                    "name": {
                        "type": "string"
                    },
                    "phone": {
                        "type": "string"
                    },
                    "organization": {
                        "type": "string"
                    },
                    "skipSMSNotifications": {
                        "type": "boolean"
                    },
                    "notes": {
                        "type": "string"
                    }
                },
                "required": [
                    "id",
                    "timeCreated",
                    "timeLastModified",
                    "name",
                    "phone",
                    "organization",
                    "skipSMSNotifications",
                    "metadata"
                ]
            }
        },
        "destination": {
            "type": "object",
            "properties": {
                "id": {
                    "type": "string"
                },
                "timeCreated": {
                    "type": "integer"
                },
                "timeLastModified": {
                    "type": "integer"
                },
                "location": {
                    "type": "array",
                    "items": {
                        "type": "number"
                    }
                },
                "address": {
                    "type": "object",
                    "properties": {
                        "name": {
                            "type": "string"
                        },
                        "number": {
                            "type": "string"
                        },
                        "street": {
                            "type": "string"
                        },
                        "apartment": {
                            "type": "string"
                        },
                        "city": {
                            "type": "string"
                        },
                        "state": {
                            "type": "string"
                        },
                        "postalCode": {
                            "type": "string"
                        },
                        "country": {
                            "type": "string"
                        }
                    },
                    "required": [
                        "apartment",
                        "city",
                        "state",
                        "postalCode",
                        "country"
                    ]
                },
                "notes": {
                    "type": "string"
                },
                "warnings": {
                    "type": "array",
                    "items": {
                        "type": "string"
                    }
                },
                "useGPS": {
                    "type": "boolean"
                }
            },
            "required": [
                "id",
                "timeCreated",
                "timeLastModified",
                "location",
                "address",
                "notes",
                "metadata",
                "googlePlaceId",
                "warnings",
                "useGPS"
            ]
        }
    },
    "required": [
        "id",
        "timeCreated",
        "timeLastModified",
        "organization",
        "shortId",
        "orderShortId",
        "trackingURL",
        "worker",
        "merchant",
        "executor",
        "creator",
        "dependencies",
        "state",
        "completeAfter",
        "completeBefore",
        "pickupTask",
        "notes",
        "completionDetails",
        "feedback",
        "metadata",
        "overrides",
        "quantity",
        "additionalQuantities",
        "serviceTime",
        "identity",
        "appearance",
        "scanOnlyRequiredBarcodes",
        "customFields",
        "trackingViewed",
        "delayTime",
        "estimatedCompletionTime",
        "estimatedArrivalTime",
        "eta",
        "recipients",
        "destination"
    ],
    "version": 1
}
