{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://teamshift.io/human-api/task-spec/v1/photo.schema.json",
  "title": "Exterior photo or drive-by check",
  "description": "Up to 15 minutes on site. Photos from public ground.",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "task_type",
    "spec_version",
    "risk_tier",
    "inputs",
    "proof"
  ],
  "properties": {
    "task_type": {
      "const": "photo"
    },
    "spec_version": {
      "const": "1"
    },
    "risk_tier": {
      "const": "exterior"
    },
    "inputs": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "location",
        "subjects"
      ],
      "properties": {
        "location": {
          "$ref": "common.schema.json#/$defs/location"
        },
        "window": {
          "$ref": "common.schema.json#/$defs/window"
        },
        "instructions": {
          "$ref": "common.schema.json#/$defs/instructions"
        },
        "subjects": {
          "type": "array",
          "minItems": 1,
          "maxItems": 10,
          "items": {
            "type": "string",
            "maxLength": 120
          },
          "description": "What to photograph.",
          "examples": [
            [
              "Front of the house",
              "Driveway"
            ]
          ]
        }
      }
    },
    "proof": {
      "allOf": [
        {
          "$ref": "common.schema.json#/$defs/proof"
        }
      ],
      "default": {
        "shots": 2,
        "geofence_radius_m": 250,
        "capture_window": {
          "not_before": "dispatch"
        },
        "channel": "capture_link"
      }
    },
    "output": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "observations"
      ],
      "properties": {
        "observations": {
          "type": "array",
          "maxItems": 10,
          "items": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "subject",
              "visible"
            ],
            "properties": {
              "subject": {
                "type": "string",
                "maxLength": 120
              },
              "visible": {
                "type": "boolean"
              },
              "note": {
                "$ref": "common.schema.json#/$defs/note"
              }
            }
          }
        },
        "note": {
          "$ref": "common.schema.json#/$defs/note"
        }
      }
    }
  }
}
