{
  "title": "Partial Test Result ADI 2 Schema",
  "type": "object",
  "definitions": {
    "eyesightTest": {
      "$ref": "../common/index.json#/definitions/eyesightTest"
    },
    "faultComments": {
      "$ref": "../common/index.json#/definitions/faultComments"
    },
    "manoeuvre": {
      "$ref": "../common/index.json#/definitions/manoeuvre"
    },
    "manoeuvreOutcome": {
      "$ref": "../common/index.json#/definitions/manoeuvreOutcome"
    },
    "questionResult": {
      "$ref": "../common/index.json#/definitions/questionResult"
    },
    "manoeuvreIndicator": {
      "$ref": "../common/index.json#/definitions/manoeuvreIndicator"
    },
    "vehicleChecks": {
      "additionalProperties": false,
      "description": "Details of the Show Me and Tell Me questions asked during the test",
      "properties": {
        "seriousFault": {
          "description": "Indicates whether or not a serious fault is marked against vehicle checks",
          "type": "boolean"
        },
        "dangerousFault": {
          "description": "Indicates whether or not a dangerous fault is marked against vehicle checks",
          "type": "boolean"
        },
        "showMeQuestions": {
          "items": {
            "$ref": "#/definitions/questionResult"
          },
          "type": "array"
        },
        "showMeTellMeComments": {
          "$ref": "#/definitions/faultComments"
        },
        "tellMeQuestions": {
          "items": {
            "$ref": "#/definitions/questionResult"
          },
          "type": "array"
        },
        "vehicleChecksCompleted": {
          "description" : "Indicates whether the vehicle checks has been completed",
          "type": "boolean"
        }
      },
      "type": "object"
    },
    "vehicleDetails": {
      "properties": {
        "schoolCar": {
          "$ref": "../common/index.json#/definitions/schoolCar"
        },
        "dualControls": {
          "$ref": "../common/index.json#/definitions/dualControls"
        }
      },
      "additionalProperties": false
    },
    "preTestDeclarations": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "insuranceDeclarationAccepted": {
          "description": "Whether or not the candidate has declared that their test vehicle has a valid insurance policy",
          "type": "boolean"
        },
        "preTestSignature": {
          "$ref": "../common/index.json#/definitions/signature"
        }
      },
      "required": [
        "insuranceDeclarationAccepted",
        "preTestSignature"
      ]
    },
    "controlledStop": {
      "additionalProperties": false,
      "properties": {
        "fault": {
          "$ref": "#/definitions/manoeuvreOutcome"
        },
        "faultComments": {
          "$ref": "#/definitions/faultComments"
        },
        "selected": {
          "$ref": "#/definitions/manoeuvreIndicator"
        }
      },
      "type": "object"
    },
    "manoeuvres": {
      "additionalProperties": false,
      "type": "object",
      "description": "The manoeuvres that were carried out during the test and any faults recorded against them",
      "properties": {
        "forwardPark": {
          "$ref": "#/definitions/manoeuvre"
        },
        "reverseParkCarpark": {
          "$ref": "#/definitions/manoeuvre"
        },
        "reverseParkRoad": {
          "$ref": "#/definitions/manoeuvre"
        },
        "reverseRight": {
          "$ref": "#/definitions/manoeuvre"
        }
      }
    },
    "testData": {
      "additionalProperties": false,
      "type": "object",
      "properties": {
        "eyesightTest": {
          "$ref": "#/definitions/eyesightTest"
        },
        "testRequirements": {
          "$ref": "#/definitions/testRequirements"
        },
        "manoeuvres": {
          "items": {
            "$ref": "#/definitions/manoeuvres"
          },
          "type": "array",
          "minItems": 2,
          "maxItems": 2
        },
        "vehicleChecks": {
          "$ref": "#/definitions/vehicleChecks"
        },
        "controlledStop": {
          "$ref": "#/definitions/controlledStop"
        }
      }
    },
    "testRequirements": {
      "additionalProperties": false,
      "type": "object",
      "properties": {
        "uphillStart": {
          "description": "Indicates whether or not this test requirement was carried out",
          "type": "boolean"
        },
        "downhillStart": {
          "description": "Indicates whether or not this test requirement was carried out",
          "type": "boolean"
        },
        "angledStart": {
          "description": "Indicates whether or not this test requirement was carried out",
          "type": "boolean"
        }
      }
    },
    "trainerDetails": {
      "additionalProperties": false,
      "type": "object",
      "properties": {
        "orditTrainedCandidate": {
          "description": "Did the candidate receive training from an ORDIT trainer",
          "type": "boolean"
        },
        "trainerRegistrationNumber": {
          "description": "Trainer registration number",
          "type": "number",
          "maxLength": 7
        },
        "trainingRecords": {
          "description": "Training records recorded",
          "type": "boolean"
        }
      }
    }
  },
  "properties": {
    "testData": {
      "$ref": "#/definitions/testData"
    },
    "vehicleDetails": {
      "$ref": "#/definitions/vehicleDetails"
    },
    "preTestDeclarations": {
      "$ref": "#/definitions/preTestDeclarations"
    },
    "trainerDetails": {
      "$ref": "#/definitions/trainerDetails"
    }
  },
  "additionalProperties": false,
  "required": []
}
