{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/lexiel-ai/json-schema/lexiel-ai-case-create-schema.json",
  "title": "CaseCreate",
  "x-generated": "2026-11-15",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/lexiel-ai-openapi.yml#/components/schemas/CaseCreate",
  "type": "object",
  "required": [
    "title"
  ],
  "properties": {
    "title": {
      "type": "string",
      "minLength": 1,
      "maxLength": 500
    },
    "caseNumber": {
      "type": "string",
      "maxLength": 100,
      "description": "Referencia interna"
    },
    "courtCaseNumber": {
      "type": "string",
      "maxLength": 100,
      "description": "Número de procedimiento judicial"
    },
    "practiceArea": {
      "type": "string",
      "enum": [
        "civil",
        "penal",
        "laboral",
        "mercantil",
        "contencioso_administrativo",
        "familia",
        "propiedad_intelectual",
        "fiscal",
        "internacional",
        "general"
      ]
    },
    "jurisdiction": {
      "type": "string",
      "enum": [
        "civil",
        "penal",
        "contencioso_administrativo",
        "social",
        "mercantil",
        "constitucional",
        "militar",
        "europeo"
      ]
    },
    "role": {
      "type": "string",
      "enum": [
        "demandante",
        "demandado",
        "acusado",
        "denunciante",
        "recurrente",
        "other"
      ]
    },
    "factsSummary": {
      "type": "string",
      "maxLength": 50000,
      "description": "Hechos del asunto (se guardan en el expediente; el chat no los lee: el contexto de cada consulta va en su `content` y en los documentos del expediente)"
    },
    "clientId": {
      "type": "string",
      "format": "uuid"
    },
    "parties": {
      "type": "object",
      "properties": {
        "client": {
          "type": "object",
          "required": [
            "name"
          ],
          "properties": {
            "name": {
              "type": "string"
            },
            "dni": {
              "type": "string"
            },
            "address": {
              "type": "string"
            },
            "phone": {
              "type": "string"
            },
            "email": {
              "type": "string",
              "format": "email"
            }
          }
        },
        "opposing": {
          "type": "object",
          "required": [
            "name"
          ],
          "properties": {
            "name": {
              "type": "string"
            },
            "dni": {
              "type": "string"
            },
            "lawyer": {
              "type": "string"
            }
          }
        },
        "court": {
          "type": "object",
          "required": [
            "name"
          ],
          "properties": {
            "name": {
              "type": "string"
            },
            "section": {
              "type": "string"
            },
            "judge": {
              "type": "string"
            }
          }
        }
      }
    }
  }
}