{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "Japanese Order Eval 1.0 output",
  "type": "object",
  "required": [
    "action",
    "currency",
    "delivery_date",
    "issues",
    "items",
    "reference",
    "status",
    "tax_included"
  ],
  "additionalProperties": false,
  "properties": {
    "action": {
      "enum": [
        "quote",
        "order",
        "change",
        "cancel",
        "unknown"
      ]
    },
    "reference": {
      "type": [
        "string",
        "null"
      ]
    },
    "currency": {
      "enum": [
        "JPY",
        "USD"
      ]
    },
    "tax_included": {
      "type": [
        "boolean",
        "null"
      ]
    },
    "delivery_date": {
      "type": [
        "string",
        "null"
      ],
      "format": "date"
    },
    "issues": {
      "type": "array",
      "items": {
        "enum": [
          "ambiguous_date",
          "ambiguous_quantity",
          "ambiguous_unit",
          "conflicting_action",
          "conflicting_date",
          "conflicting_quantity",
          "insufficient_context",
          "missing_quantity",
          "missing_reference",
          "unknown_request",
          "unsupported_currency",
          "untrusted_instruction"
        ]
      },
      "uniqueItems": true
    },
    "status": {
      "enum": [
        "complete",
        "needs_review",
        "cancelled"
      ]
    },
    "items": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "product",
          "quantity",
          "unit",
          "unit_price"
        ],
        "additionalProperties": false,
        "properties": {
          "product": {
            "type": "string",
            "minLength": 1
          },
          "unit": {
            "type": [
              "string",
              "null"
            ],
            "minLength": 1
          },
          "quantity": {
            "type": [
              "string",
              "null"
            ],
            "pattern": "^(?:0|[1-9][0-9]*)(?:\\.[0-9]*[1-9])?$"
          },
          "unit_price": {
            "type": [
              "string",
              "null"
            ],
            "pattern": "^(?:0|[1-9][0-9]*)(?:\\.[0-9]*[1-9])?$"
          }
        }
      }
    }
  }
}
