{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/softsync-ai/json-schema/softsync-ai-document-dto-schema.json",
  "title": "DocumentDto",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/softsync-ai-documents-api-openapi.yml#/components/schemas/DocumentDto",
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "templateId": {
      "type": "string"
    },
    "recordId": {
      "type": "string"
    },
    "status": {
      "allOf": [
        {
          "$ref": "#/$defs/DocumentStatus"
        }
      ]
    },
    "error": {
      "type": "string",
      "description": "Why the PDF could not be made"
    },
    "file": {
      "$ref": "#/$defs/FileAttachment"
    },
    "createdAt": {
      "type": "string",
      "format": "date-time"
    },
    "createdBy": {
      "type": "string"
    }
  },
  "required": [
    "id",
    "templateId",
    "recordId",
    "status",
    "createdAt"
  ],
  "$defs": {
    "DocumentStatus": {
      "type": "string",
      "enum": [
        "queued",
        "done",
        "failed"
      ]
    },
    "FileAttachment": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "path": {
          "type": "string"
        },
        "fileName": {
          "type": "string"
        },
        "fileSize": {
          "type": "number"
        },
        "mime": {
          "type": "string"
        },
        "isInline": {
          "type": "boolean"
        },
        "contentId": {
          "type": "string"
        },
        "url": {
          "type": "string"
        }
      },
      "required": [
        "id",
        "path",
        "fileName",
        "fileSize",
        "mime"
      ]
    }
  }
}