{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/damdafa-com/json-schema/damdafa-com-video-document-schema.json",
  "title": "VideoDocument",
  "description": "Firestore document structure for a video job.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/damdafa-com-video-api-openapi.yml#/components/schemas/VideoDocument",
  "properties": {
    "id": {
      "type": "string",
      "title": "Id"
    },
    "projectId": {
      "type": "string",
      "title": "Projectid"
    },
    "versionId": {
      "type": "string",
      "title": "Versionid"
    },
    "status": {
      "$ref": "#/$defs/VIDEO_STATUS"
    },
    "prompt": {
      "type": "string",
      "title": "Prompt"
    },
    "plan": {
      "anyOf": [
        {
          "$ref": "#/$defs/VideoPlanSchema"
        },
        {
          "type": "null"
        }
      ]
    },
    "videoUrl": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Videourl"
    },
    "thumbnailUrl": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Thumbnailurl"
    },
    "createdAt": {
      "type": "string",
      "format": "date-time",
      "title": "Createdat"
    },
    "updatedAt": {
      "type": "string",
      "format": "date-time",
      "title": "Updatedat"
    },
    "error": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Error"
    },
    "errorCode": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Errorcode"
    }
  },
  "type": "object",
  "required": [
    "id",
    "projectId",
    "versionId",
    "status",
    "prompt",
    "createdAt",
    "updatedAt"
  ],
  "$defs": {
    "VIDEO_STATUS": {
      "type": "string",
      "enum": [
        "PENDING",
        "PLANNING",
        "GENERATING",
        "COMPLETED",
        "FAILED"
      ],
      "title": "VIDEO_STATUS"
    },
    "VideoPlanSchema": {
      "properties": {
        "plan": {
          "type": "string",
          "title": "Plan",
          "description": "The creative concept and narrative plan for the video."
        },
        "steps": {
          "items": {
            "type": "string"
          },
          "type": "array",
          "title": "Steps",
          "description": "Step by step execution breakdown."
        },
        "prompt_for_veo": {
          "type": "string",
          "title": "Prompt For Veo",
          "description": "The highly detailed, visual prompt to be sent to the video generation AI."
        },
        "rationale": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Rationale",
          "description": "Reasoning behind the plan."
        }
      },
      "type": "object",
      "required": [
        "plan",
        "prompt_for_veo"
      ],
      "title": "VideoPlanSchema",
      "description": "Schema for the video generation plan structure output by the LLM."
    }
  }
}