{
  "$id": "https://schema.nfh.global/CatalogProcessingResult/v2.0",
  "x-iri": "https://schema.nfh.global/CatalogProcessingResult/v2.0",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "description": "Processing result for a single catalog submission.",
  "type": "object",
  "required": [
    "catalogId",
    "status"
  ],
  "properties": {
    "catalogId": {
      "type": "string",
      "description": "Identifier of the submitted catalog"
    },
    "status": {
      "description": "Processing outcome. Using oneOf [string, object] to allow domain-specific status objects (e.g. beckn:CatalogAccepted) alongside standard string codes.",
      "type": "string",
      "enum": [
        "ACCEPTED",
        "REJECTED",
        "PARTIAL"
      ]
    },
    "errors": {
      "type": "array",
      "description": "Per-item or per-catalog errors (present when REJECTED or PARTIAL)",
      "items": {
        "$ref": "https://schema.nfh.global/Error/v2.0/schema.json"
      }
    },
    "stats": {
      "type": "object",
      "description": "Optional statistics about the processed catalog",
      "properties": {
        "itemCount": {
          "type": "integer",
          "description": "Number of items accepted"
        },
        "providerCount": {
          "type": "integer",
          "description": "Number of providers in the catalog"
        },
        "categoryCount": {
          "type": "integer",
          "description": "Number of distinct categories"
        }
      }
    }
  }
}
