{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://quickiso.app/data-portability/tables/ai_generation_jobs.schema.json",
  "title": "tables/ai_generation_jobs.json",
  "description": "The rows of the table ai_generation_jobs that belong to the workspace, one object per row, keyed by the database's column names.",
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "id": {
        "type": "string",
        "format": "uuid"
      },
      "organization_id": {
        "type": "string",
        "format": "uuid"
      },
      "kind": {
        "type": "string",
        "enum": [
          "policy_draft"
        ]
      },
      "status": {
        "type": "string",
        "enum": [
          "queued",
          "running",
          "succeeded",
          "failed",
          "blocked"
        ]
      },
      "requested_by": {
        "type": "string",
        "format": "uuid"
      },
      "input": {
        "type": [
          "object",
          "array",
          "string",
          "number",
          "boolean",
          "null"
        ]
      },
      "template_key": {
        "type": "string"
      },
      "template_version": {
        "type": "string"
      },
      "locale": {
        "type": "string",
        "enum": [
          "en",
          "pl"
        ]
      },
      "provider": {
        "type": [
          "string",
          "null"
        ]
      },
      "model": {
        "type": [
          "string",
          "null"
        ]
      },
      "config_version": {
        "type": [
          "string",
          "null"
        ]
      },
      "input_tokens": {
        "type": [
          "integer",
          "null"
        ]
      },
      "output_tokens": {
        "type": [
          "integer",
          "null"
        ]
      },
      "cost_micro_usd": {
        "type": [
          "integer",
          "null"
        ]
      },
      "attempts": {
        "type": "integer"
      },
      "error_code": {
        "type": [
          "string",
          "null"
        ]
      },
      "document_id": {
        "type": [
          "string",
          "null"
        ],
        "format": "uuid"
      },
      "document_version_id": {
        "type": [
          "string",
          "null"
        ],
        "format": "uuid"
      },
      "created_at": {
        "type": "string",
        "format": "date-time",
        "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$"
      },
      "started_at": {
        "type": [
          "string",
          "null"
        ],
        "format": "date-time",
        "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$"
      },
      "finished_at": {
        "type": [
          "string",
          "null"
        ],
        "format": "date-time",
        "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$"
      }
    },
    "required": [
      "id",
      "organization_id",
      "kind",
      "status",
      "requested_by",
      "input",
      "template_key",
      "template_version",
      "locale",
      "provider",
      "model",
      "config_version",
      "input_tokens",
      "output_tokens",
      "cost_micro_usd",
      "attempts",
      "error_code",
      "document_id",
      "document_version_id",
      "created_at",
      "started_at",
      "finished_at"
    ],
    "additionalProperties": false
  }
}
