{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://thesoftwarelens.com/saacip/0.2/schemas/inbox.schema.json",
  "$comment": "SaaCIP 0.2 (https://thesoftwarelens.com/saacip/). Licensed under the Apache License 2.0.",
  "title": "SaaCIP 0.2 HTTP binding: inbox",
  "description": "200 response to GET <base>/inbox/: decisions and judgements not yet acknowledged, and whether the hirer asked for release.",
  "type": "object",
  "required": [
    "approvals",
    "outcomes",
    "release_requested"
  ],
  "properties": {
    "approvals": {
      "type": "array",
      "items": {
        "allOf": [
          {
            "$ref": "approval.schema.json"
          },
          {
            "properties": {
              "status": {
                "enum": [
                  "approved",
                  "rejected"
                ]
              }
            }
          }
        ]
      }
    },
    "outcomes": {
      "type": "array",
      "items": {
        "$ref": "outcome.schema.json"
      }
    },
    "release_requested": {
      "type": "boolean"
    },
    "work_items": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "hub_ref",
          "subject",
          "description_html",
          "origin",
          "role"
        ],
        "properties": {
          "hub_ref": {
            "type": "string"
          },
          "subject": {
            "type": "string"
          },
          "description_html": {
            "type": "string"
          },
          "priority_level": {
            "type": "integer",
            "minimum": 1,
            "maximum": 4
          },
          "origin": {
            "$ref": "common.schema.json#/$defs/origin"
          },
          "role": {
            "$ref": "common.schema.json#/$defs/roleName"
          }
        }
      },
      "description": "Work items handed to a role this hire holds, not yet acknowledged (section 6.5). Untrusted input. Added in 0.2."
    }
  }
}
