{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "source_id",
    "invoice_id",
    "supplier",
    "total",
    "currency",
    "status",
    "missing_fields",
    "evidence",
    "next_action"
  ],
  "properties": {
    "source_id": {
      "type": "string"
    },
    "invoice_id": {
      "type": [
        "string",
        "null"
      ]
    },
    "supplier": {
      "type": [
        "string",
        "null"
      ]
    },
    "total": {
      "type": [
        "number",
        "null"
      ]
    },
    "currency": {
      "type": [
        "string",
        "null"
      ]
    },
    "status": {
      "enum": [
        "ready_for_review",
        "needs_evidence",
        "unreadable"
      ]
    },
    "missing_fields": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "evidence": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "next_action": {
      "type": "string"
    }
  }
}