{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/softsync-ai/json-schema/softsync-ai-file-item-dto-schema.json",
  "title": "FileItemDto",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/softsync-ai-files-api-openapi.yml#/components/schemas/FileItemDto",
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "recordId": {
      "type": "string"
    },
    "parentId": {
      "type": [
        "string",
        "null"
      ]
    },
    "kind": {
      "allOf": [
        {
          "$ref": "#/$defs/FileItemKind"
        }
      ]
    },
    "name": {
      "type": "string"
    },
    "file": {
      "$ref": "#/$defs/FileAttachment"
    },
    "state": {
      "allOf": [
        {
          "$ref": "#/$defs/FileItemState"
        }
      ]
    },
    "sourceId": {
      "type": "string"
    },
    "envelopeId": {
      "type": "string"
    },
    "fieldCount": {
      "type": "number",
      "description": "How many signing fields are placed on it"
    },
    "createdAt": {
      "type": "string",
      "format": "date-time"
    },
    "createdBy": {
      "type": "string"
    }
  },
  "required": [
    "id",
    "recordId",
    "parentId",
    "kind",
    "name",
    "state",
    "fieldCount",
    "createdAt"
  ],
  "$defs": {
    "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"
      ]
    },
    "FileItemKind": {
      "type": "string",
      "enum": [
        "folder",
        "upload",
        "document"
      ]
    },
    "FileItemState": {
      "type": "string",
      "enum": [
        "draft",
        "final",
        "sending",
        "signed",
        "declined",
        "voided",
        "expired"
      ]
    }
  }
}