{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/revuo-ai/json-schema/revuo-ai-batch-discovery-session-schema.json",
  "title": "BatchDiscoverySession",
  "x-generated": "2026-11-23",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/revuo-ai-openapi.json#/components/schemas/BatchDiscoverySession",
  "required": [
    "name"
  ],
  "type": "object",
  "properties": {
    "id": {
      "type": [
        "string",
        "null"
      ],
      "readOnly": true
    },
    "idCreated": {
      "type": "string",
      "format": "date-time",
      "readOnly": true
    },
    "name": {
      "type": [
        "string",
        "null"
      ]
    },
    "seedUrls": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "type": "string"
      }
    },
    "maxDepth": {
      "type": "integer",
      "format": "int32"
    },
    "maxProducts": {
      "type": "integer",
      "format": "int32"
    },
    "status": {
      "$ref": "#/$defs/BatchDiscoveryStatus"
    },
    "isCategoryDiscovery": {
      "type": "boolean"
    },
    "targetCategoryId": {
      "type": [
        "string",
        "null"
      ]
    },
    "initialFeatureGroupIds": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "type": "string"
      }
    },
    "featureSuggestions": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "$ref": "#/$defs/SuggestedFeatureGroup"
      }
    },
    "suggestionStatus": {
      "$ref": "#/$defs/FeatureSuggestionStatus"
    },
    "createdAt": {
      "type": "string",
      "format": "date-time"
    },
    "startedAt": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "completedAt": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "createdByVendorId": {
      "type": [
        "string",
        "null"
      ]
    },
    "totalQueued": {
      "type": "integer",
      "format": "int32"
    },
    "totalProcessed": {
      "type": "integer",
      "format": "int32"
    },
    "totalSucceeded": {
      "type": "integer",
      "format": "int32"
    },
    "totalFailed": {
      "type": "integer",
      "format": "int32"
    },
    "totalSkippedDuplicate": {
      "type": "integer",
      "format": "int32"
    },
    "seedSlugs": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "$ref": "#/$defs/SeedSlug"
      }
    },
    "discoveredProductIds": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "type": "string"
      }
    },
    "notes": {
      "type": [
        "string",
        "null"
      ]
    }
  },
  "additionalProperties": false,
  "$defs": {
    "BatchDiscoveryStatus": {
      "enum": [
        "pending",
        "running",
        "paused",
        "completed",
        "cancelled"
      ],
      "type": "string"
    },
    "FeatureDataType": {
      "enum": [
        "boolean",
        "number",
        "text",
        "enum",
        "multiEnum"
      ],
      "type": "string"
    },
    "FeatureSuggestionStatus": {
      "enum": [
        "notApplicable",
        "pending",
        "generated",
        "reviewed",
        "featuresCreated"
      ],
      "type": "string"
    },
    "SeedSlug": {
      "required": [
        "slug",
        "url"
      ],
      "type": "object",
      "properties": {
        "url": {
          "type": [
            "string",
            "null"
          ]
        },
        "slug": {
          "type": [
            "string",
            "null"
          ]
        }
      },
      "additionalProperties": false
    },
    "SuggestedFeature": {
      "required": [
        "name",
        "slug",
        "tempId"
      ],
      "type": "object",
      "properties": {
        "tempId": {
          "type": [
            "string",
            "null"
          ]
        },
        "name": {
          "type": [
            "string",
            "null"
          ]
        },
        "slug": {
          "type": [
            "string",
            "null"
          ]
        },
        "description": {
          "type": [
            "string",
            "null"
          ]
        },
        "dataType": {
          "$ref": "#/$defs/FeatureDataType"
        },
        "enumOptions": {
          "type": [
            "array",
            "null"
          ],
          "items": {
            "type": "string"
          }
        },
        "aiReasoning": {
          "type": [
            "string",
            "null"
          ]
        },
        "confidence": {
          "type": "number",
          "format": "double"
        },
        "status": {
          "$ref": "#/$defs/SuggestionStatus"
        },
        "createdFeatureId": {
          "type": [
            "string",
            "null"
          ]
        }
      },
      "additionalProperties": false
    },
    "SuggestedFeatureGroup": {
      "required": [
        "name",
        "slug",
        "tempId"
      ],
      "type": "object",
      "properties": {
        "tempId": {
          "type": [
            "string",
            "null"
          ]
        },
        "name": {
          "type": [
            "string",
            "null"
          ]
        },
        "slug": {
          "type": [
            "string",
            "null"
          ]
        },
        "description": {
          "type": [
            "string",
            "null"
          ]
        },
        "aiReasoning": {
          "type": [
            "string",
            "null"
          ]
        },
        "confidence": {
          "type": "number",
          "format": "double"
        },
        "status": {
          "$ref": "#/$defs/SuggestionStatus"
        },
        "features": {
          "type": [
            "array",
            "null"
          ],
          "items": {
            "$ref": "#/$defs/SuggestedFeature"
          }
        },
        "createdFeatureGroupId": {
          "type": [
            "string",
            "null"
          ]
        }
      },
      "additionalProperties": false
    },
    "SuggestionStatus": {
      "enum": [
        "pending",
        "approved",
        "modified",
        "rejected"
      ],
      "type": "string"
    }
  }
}