{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/aura-historia-com/json-schema/aura-historia-com-async-product-listing-batch-report-schema.json",
  "title": "AsyncProductListingBatchReport",
  "description": "Admission report, not a listing creation or update result. For every evaluated batch, acceptedCount plus the number of failures equals the original array length.",
  "x-generated": "2026-10-29",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/_original/aura-historia-com-internal-api-filtered-openapi.yml#/components/schemas/AsyncProductListingBatchReport",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "submissionId",
    "acceptedCount",
    "failures"
  ],
  "properties": {
    "submissionId": {
      "type": "string",
      "description": "Opaque correlation identifier only; not a status resource or batch deduplication token."
    },
    "acceptedCount": {
      "type": "integer",
      "minimum": 0,
      "maximum": 100,
      "description": "Number of publisher-confirmed admitted entries; never includes unconfirmed sends."
    },
    "failures": {
      "type": "array",
      "maxItems": 100,
      "description": "Exactly one per non-confirmed original entry, sorted by original zero-based index. Empty for fully admitted or empty batches.",
      "items": {
        "$ref": "#/$defs/AsyncProductListingBatchFailure"
      }
    }
  },
  "$defs": {
    "AsyncProductListingBatchFailure": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "index",
        "error",
        "retryable"
      ],
      "properties": {
        "index": {
          "type": "integer",
          "minimum": 0,
          "maximum": 99,
          "description": "Original zero-based batch position, authoritative even when sourceListingId cannot be echoed."
        },
        "sourceListingId": {
          "type": "string",
          "description": "Included only if present, valid, and safe to echo; omitted otherwise."
        },
        "error": {
          "type": "string",
          "pattern": "^[A-Z][A-Z0-9_]*$",
          "description": "Bounded safe code, never raw exception or payload text. Includes BAD_BODY_VALUE, PRODUCT_LISTING_INGESTION_PAYLOAD_TOO_LARGE, ENQUEUE_FAILED (definitely unsuccessful send), ENQUEUE_UNCONFIRMED (possibly queued), ENQUEUE_NOT_ATTEMPTED (budget before send), ENQUEUE_BLOCKED (eligible FIFO successor held), PRODUCT_LISTING_INGESTION_INTERNAL_ERROR, and applicable narrower item-validation codes."
        },
        "retryable": {
          "type": "boolean",
          "description": "Whether unchanged-whole-batch retry is appropriate; never permission to resubmit a compacted subset with the same key. Unconfirmed is retryable; validation and size errors are not. Blocked inherits its predecessor's retryability; deterministic configuration errors need repair."
        }
      }
    }
  }
}