{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://openeik.org/schemas/0.3/review/issue-predicate.schema.json",
  "$comment": "OpenEik 0.2: folded by tools/fold-schemas.mjs from the proposal review, which 0.2 makes a rule (decision D5). Written by hand from the text, not generated.",
  "title": "Issue statement predicate",
  "description": "The predicate of a statement about an issue, https://openeik.org/attestation/issue/v0.1 (Part XVIII, 4.1): the issue by its id and hash; issued, the sender's word that they released exactly it; received, a recipient's that they received it; withdrawn, a signer's withdrawal of their own statement about it, named by its file's hash; the signer, a person of the registry, in a role; and when, by the signer's clock (the time-stamp is the trusted time).",
  "type": "object",
  "properties": {
    "issue": {
      "description": "The issue, by its id and its record's hash.",
      "type": "object",
      "properties": {
        "id": {
          "$ref": "../drawings/defs.schema.json#/$defs/id"
        },
        "hash": {
          "description": "The issue record's hash (Part III, 6), which is also the statement's subject's digest.",
          "$ref": "../drawings/defs.schema.json#/$defs/hash"
        }
      },
      "required": [
        "id",
        "hash"
      ],
      "x-eik-closed": true
    },
    "action": {
      "type": "string",
      "enum": [
        "issued",
        "received",
        "withdrawn"
      ]
    },
    "signer": {
      "$ref": "../drawings/defs.schema.json#/$defs/person"
    },
    "role": {
      "$ref": "../drawings/defs.schema.json#/$defs/role"
    },
    "at": {
      "$ref": "../drawings/defs.schema.json#/$defs/time"
    },
    "withdraws": {
      "description": "For withdrawn: the hash of the statement file it withdraws.",
      "$ref": "../drawings/defs.schema.json#/$defs/hash"
    }
  },
  "required": [
    "issue",
    "action",
    "signer",
    "at"
  ],
  "allOf": [
    {
      "if": {
        "properties": {
          "action": {
            "const": "withdrawn"
          }
        },
        "required": [
          "action"
        ]
      },
      "then": {
        "required": [
          "withdraws"
        ]
      }
    }
  ],
  "x-eik-closed": true
}
