{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://reconcile.agiscorecard.com/input.schema.json",
  "title": "Stable Reconcile input structure",
  "description": "Structural contract. The engine additionally validates ranges, dates, amounts, uniqueness and cross-field constraints; passing this schema is not a complete validation.",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "invoices",
    "transfers"
  ],
  "properties": {
    "invoices": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "network",
          "asset",
          "amount"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "network": {
            "type": "string"
          },
          "asset": {
            "type": "string"
          },
          "amount": {
            "type": "string"
          }
        }
      }
    },
    "transfers": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "invoice",
          "network",
          "asset",
          "amount",
          "state"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "invoice": {
            "type": "string"
          },
          "network": {
            "type": "string"
          },
          "asset": {
            "type": "string"
          },
          "amount": {
            "type": "string"
          },
          "state": {
            "type": "string",
            "enum": [
              "finalized",
              "pending",
              "reverted"
            ]
          }
        }
      }
    }
  }
}
