{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/declararfacil-com/json-schema/declararfacil-com-batch-result-schema.json",
  "title": "BatchResult",
  "x-generated": "2026-11-05",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/declararfacil-com-openapi.json#/components/schemas/BatchResult",
  "type": "object",
  "properties": {
    "summary": {
      "type": "object",
      "properties": {
        "total": {
          "type": "integer"
        },
        "accepted": {
          "type": "integer"
        },
        "duplicates": {
          "type": "integer"
        },
        "rejected": {
          "type": "integer"
        }
      }
    },
    "results": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "index": {
            "type": "integer"
          },
          "status": {
            "type": "string",
            "enum": [
              "accepted",
              "duplicate",
              "rejected"
            ]
          },
          "id": {
            "type": "string"
          },
          "existing_id": {
            "type": "string"
          },
          "reason": {
            "type": "string"
          },
          "reason_code": {
            "type": "string"
          },
          "matched_fields": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "review_candidate": {
            "type": "object",
            "additionalProperties": true
          },
          "errors": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "warnings": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      }
    },
    "next_action": {
      "type": "string"
    }
  }
}