{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://teamshift.io/human-api/task-spec/v1/errand.schema.json",
  "title": "Errand",
  "description": "Billed by the hour, 1 hour minimum. Purchases and parking are passed through at cost.",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "task_type",
    "spec_version",
    "risk_tier",
    "inputs",
    "proof"
  ],
  "properties": {
    "task_type": {
      "const": "errand"
    },
    "spec_version": {
      "const": "1"
    },
    "risk_tier": {
      "const": "exterior"
    },
    "inputs": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "location",
        "errand"
      ],
      "properties": {
        "location": {
          "$ref": "common.schema.json#/$defs/location"
        },
        "window": {
          "$ref": "common.schema.json#/$defs/window"
        },
        "instructions": {
          "$ref": "common.schema.json#/$defs/instructions"
        },
        "errand": {
          "type": "string",
          "minLength": 3,
          "maxLength": 1000,
          "description": "What to do."
        },
        "hours": {
          "type": "integer",
          "minimum": 1,
          "maximum": 8,
          "default": 1
        },
        "purchase_limit_cents": {
          "type": "integer",
          "minimum": 0,
          "maximum": 50000,
          "default": 0,
          "description": "Most the person may spend on your behalf. Passed through at cost."
        }
      }
    },
    "proof": {
      "allOf": [
        {
          "$ref": "common.schema.json#/$defs/proof"
        }
      ],
      "default": {
        "shots": 1,
        "capture_window": {
          "not_before": "dispatch"
        },
        "channel": "capture_link"
      }
    },
    "output": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "done"
      ],
      "properties": {
        "done": {
          "type": "boolean"
        },
        "spent_cents": {
          "type": "integer",
          "minimum": 0
        },
        "note": {
          "$ref": "common.schema.json#/$defs/note"
        }
      }
    }
  }
}
