{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/emporix/main/json-schema/emporix-dynamic-variant-recalculation-job-response-schema.json",
  "title": "dynamicVariantRecalculationJobResponse",
  "description": "Represents a single dynamic variant recalculation job. One job is created per unique root product. Jobs remain queryable until automatically removed approximately 30 days after reaching a terminal state.\n",
  "x-generated": "2026-10-18",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/emporix-product-service-openapi.yml#/components/schemas/dynamicVariantRecalculationJobResponse",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Unique identifier of the recalculation job."
    },
    "parentRoot": {
      "type": "string",
      "description": "Identifier of the root product whose variant tree is being recalculated."
    },
    "requestedByIds": {
      "type": "array",
      "description": "List of product IDs that were submitted in the recalculation request and resolved to this root.",
      "items": {
        "type": "string"
      }
    },
    "status": {
      "$ref": "#/$defs/dynamicVariantRecalculationJobStatus"
    },
    "createdAt": {
      "type": "string",
      "format": "date-time",
      "description": "Timestamp when the job was created."
    },
    "processingStartedAt": {
      "type": "string",
      "format": "date-time",
      "description": "Timestamp when a subscriber picked up the job and started processing. Null while the job is still PENDING."
    },
    "finishedAt": {
      "type": "string",
      "format": "date-time",
      "description": "Timestamp when the job reached a terminal state (FINISHED, FAILED, or FAILED_PERMANENT)."
    },
    "error": {
      "type": "string",
      "description": "Error message if the job failed. Null for successful jobs."
    },
    "attempts": {
      "type": "integer",
      "description": "Number of processing attempts made for this job. Incremented on each delivery from the pub/sub subscription."
    }
  },
  "$defs": {
    "dynamicVariantRecalculationJobStatus": {
      "type": "string",
      "description": "Current status of a dynamic variant recalculation job.",
      "enum": [
        "PENDING",
        "PROCESSING",
        "FINISHED",
        "FAILED",
        "FAILED_PERMANENT"
      ]
    }
  }
}