{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "https://layouts.tjrj.jus.br/sfe/interdicoes/v3.0.0/layout_schema.json",
  "title": "Layout SFE/Interdicoes v3.0.0",
  "description": "Contrato JSON do Selo de Fiscalizacao Eletronico para a atribuicao Registro de Interdicoes e Tutelas (RIT) da CGJ-RJ. Sucessor do Schema_Int_Tutela_2.00.xsd. JSON Schema draft-07.",
  "type": "object",
  "additionalProperties": false,
  "required": ["remessa"],
  "properties": {
    "$schema": {
      "type": "string",
      "format": "uri",
      "description": "URI canonica do schema (auto-discovery)."
    },
    "remessa": { "$ref": "#/$defs/Remessa" }
  },

  "$defs": {

    "Remessa": {
      "type": "object",
      "title": "Envelope da remessa Interdicoes",
      "description": "Envelope canonico de transmissao de atos de Registro de Interdicoes e Tutelas. Substitui o elemento InterdicoesTutelas/Remessa do XML 2.00.",
      "additionalProperties": false,
      "required": [
        "id",
        "versaoLayout",
        "codigoServico",
        "tipoOperacao",
        "ambiente",
        "software",
        "dataGeracao"
      ],
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid",
          "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$",
          "description": "Identificador unico da remessa, em UUID v4. Usado para idempotencia."
        },
        "versaoLayout": {
          "type": "string",
          "pattern": "^\\d+\\.\\d+\\.\\d+$",
          "description": "Versao semantica do layout. Para esta especificacao: 3.0.0."
        },
        "codigoServico": {
          "type": "string",
          "pattern": "^\\d{1,5}$",
          "description": "Codigo do servico extrajudicial emissor (CodServico do XML 2.00)."
        },
        "tipoOperacao": {
          "type": "string",
          "enum": ["INCLUSAO", "ALTERACAO"],
          "description": "Operacao da remessa. INCLUSAO substitui 'I'; ALTERACAO substitui 'A'."
        },
        "ambiente": {
          "type": "string",
          "enum": ["HOMOLOGACAO", "PRODUCAO"],
          "description": "Ambiente alvo. HOMOLOGACAO substitui 'HML'; PRODUCAO substitui 'PRD'."
        },
        "software": {
          "type": "object",
          "title": "Software emissor",
          "additionalProperties": false,
          "required": ["nome", "versao"],
          "properties": {
            "nome": { "type": "string", "minLength": 2, "maxLength": 100 },
            "versao": { "type": "string", "minLength": 1, "maxLength": 50 }
          }
        },
        "dataGeracao": {
          "type": "string",
          "format": "date-time",
          "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}([.,]\\d+)?(Z|[+-]\\d{2}:\\d{2})$",
          "description": "Instante de geracao da remessa, ISO 8601 com offset (ex.: 2026-05-07T13:21:45-03:00)."
        },
        "atos": {
          "type": "array",
          "minItems": 0,
          "maxItems": 5000,
          "description": "Lista de atos da remessa (max. 5000). Cada item discriminado por tipoAto.",
          "items": { "$ref": "#/$defs/Ato" }
        },
        "justificativasAusencia": {
          "type": "array",
          "minItems": 0,
          "description": "Datas em que nenhum ato foi praticado (substitui JustificativaAtoNaoPraticado).",
          "items": { "$ref": "#/$defs/JustificativaAusencia" }
        }
      }
    },

    "JustificativaAusencia": {
      "type": "object",
      "title": "Justificativa de ato nao praticado",
      "description": "Substitui JustificativaAtoNaoPraticado do XML 2.00.",
      "additionalProperties": false,
      "required": ["data"],
      "properties": {
        "data": { "type": "string", "format": "date" },
        "motivo": { "type": "string", "minLength": 2, "maxLength": 250 }
      }
    },

    "Ato": {
      "type": "object",
      "title": "Item de ato",
      "description": "Estrutura discriminada: tipoAto identifica o ato; dadosAto carrega o payload especifico.",
      "additionalProperties": false,
      "required": ["tipoAto", "dadosAto"],
      "properties": {
        "tipoAto": {
          "type": "string",
          "enum": [
            "REGISTRO_INTERDICAO_TUTELA",
            "CERTIDAO_INTERDICAO_TUTELA",
            "AVERBACAO_INTERDICAO_TUTELA",
            "PROCESSO_ADMINISTRATIVO",
            "CERTIDAO_CRC",
            "CERTIDAO_CRC_NACIONAL",
            "REGISTRO_LIVRO_E",
            "CERTIDAO_LIVRO_E",
            "AVERBACAO_LIVRO_E",
            "CERTIDAO_GENERICA",
            "APOSTILAMENTO",
            "VISTO",
            "ENCERRAMENTO_LIVRO",
            "FOLHA_ADICIONAL_COMPLEMENTO",
            "INFORMACAO_VERBAL",
            "COMPLEMENTO_EMOLUMENTOS",
            "ALTERACAO_EMOLUMENTOS"
          ]
        },
        "dadosAto": { "type": "object" }
      },
      "oneOf": [
        { "properties": { "tipoAto": { "const": "REGISTRO_INTERDICAO_TUTELA" }, "dadosAto": { "$ref": "#/$defs/RegistroInterdicaoTutela" } } },
        { "properties": { "tipoAto": { "const": "CERTIDAO_INTERDICAO_TUTELA" }, "dadosAto": { "$ref": "#/$defs/CertidaoInterdicaoTutela" } } },
        { "properties": { "tipoAto": { "const": "AVERBACAO_INTERDICAO_TUTELA" }, "dadosAto": { "$ref": "#/$defs/AverbacaoInterdicaoTutela" } } },
        { "properties": { "tipoAto": { "const": "PROCESSO_ADMINISTRATIVO" }, "dadosAto": { "$ref": "#/$defs/ProcessoAdministrativo" } } },
        { "properties": { "tipoAto": { "const": "CERTIDAO_CRC" }, "dadosAto": { "$ref": "#/$defs/CertidaoCRC" } } },
        { "properties": { "tipoAto": { "const": "CERTIDAO_CRC_NACIONAL" }, "dadosAto": { "$ref": "#/$defs/CertidaoCRCNacional" } } },
        { "properties": { "tipoAto": { "const": "REGISTRO_LIVRO_E" }, "dadosAto": { "$ref": "#/$defs/RegistroLivroE" } } },
        { "properties": { "tipoAto": { "const": "CERTIDAO_LIVRO_E" }, "dadosAto": { "$ref": "#/$defs/CertidaoLivroE" } } },
        { "properties": { "tipoAto": { "const": "AVERBACAO_LIVRO_E" }, "dadosAto": { "$ref": "#/$defs/AverbacaoLivroE" } } },
        { "properties": { "tipoAto": { "const": "CERTIDAO_GENERICA" }, "dadosAto": { "$ref": "#/$defs/CertidaoGenerica" } } },
        { "properties": { "tipoAto": { "const": "APOSTILAMENTO" }, "dadosAto": { "$ref": "#/$defs/Apostilamento" } } },
        { "properties": { "tipoAto": { "const": "VISTO" }, "dadosAto": { "$ref": "#/$defs/Visto" } } },
        { "properties": { "tipoAto": { "const": "ENCERRAMENTO_LIVRO" }, "dadosAto": { "$ref": "#/$defs/EncerramentoLivro" } } },
        { "properties": { "tipoAto": { "const": "FOLHA_ADICIONAL_COMPLEMENTO" }, "dadosAto": { "$ref": "#/$defs/FolhaAdicionalComplemento" } } },
        { "properties": { "tipoAto": { "const": "INFORMACAO_VERBAL" }, "dadosAto": { "$ref": "#/$defs/InformacaoVerbal" } } },
        { "properties": { "tipoAto": { "const": "COMPLEMENTO_EMOLUMENTOS" }, "dadosAto": { "$ref": "#/$defs/ComplementoEmolumentos" } } },
        { "properties": { "tipoAto": { "const": "ALTERACAO_EMOLUMENTOS" }, "dadosAto": { "$ref": "#/$defs/AlteracaoEmolumentos" } } }
      ]
    },

    "AtoBase": {
      "type": "object",
      "title": "Campos comuns de ato selado",
      "description": "Campos compartilhados por atos selados (categoria=ATO_SELADO). Substitui o complexType Ato do XSD 2.00.",
      "properties": {
        "categoria": {
          "type": "string",
          "const": "ATO_SELADO",
          "description": "Categoria do ato. ATO_SELADO usa selo SFE."
        },
        "dataPratica": {
          "type": "string",
          "format": "date",
          "description": "Data da pratica do ato (ISO 8601). Substitui DataPratica (dd/mm/aaaa)."
        },
        "selo": {
          "type": "string",
          "pattern": "^[A-Z]{4}\\d{5}$",
          "description": "Selo SFE no formato 4 letras + 5 digitos (ex.: EABC12345)."
        },
        "aleatorio": {
          "type": "string",
          "pattern": "^[A-Z]{3}$",
          "description": "Aleatorio do selo SFE (3 letras maiusculas)."
        },
        "atoOriginal": { "$ref": "#/$defs/ReferenciaAto" },
        "atoReferencia": { "$ref": "#/$defs/ReferenciaAto" },
        "livro": { "type": "string", "minLength": 1, "maxLength": 25 },
        "folha": { "type": "string", "minLength": 1, "maxLength": 25 },
        "termo": { "type": "integer", "minimum": 0, "maximum": 9999999999 },
        "matriculaNacional": {
          "type": "string",
          "pattern": "^\\d{32}$",
          "description": "Matricula nacional (32 digitos), conforme Decreto 6.828/2009 e Provimentos 2 e 3/2009 CNJ."
        },
        "tipoLivro": {
          "type": "string",
          "pattern": "^[1-9]$",
          "description": "Codigo numerico do tipo de livro (1 a 9), preservado por ser indexador externo CGJ-RJ."
        },
        "ordemJudicial": {
          "type": "boolean",
          "description": "Indica se o ato decorre de ordem judicial. Substitui OrdemJudicial 'S'/'N'."
        },
        "numeroProcessoJudicial": { "type": "string", "minLength": 1, "maxLength": 25 },
        "dataSentencaDecisao": { "type": "string", "format": "date" },
        "dataInicioEficacia": {
          "type": "string",
          "format": "date",
          "description": "Data inicial de eficacia da Certidao Eletronica. Provimento CGJ 36/2022 revogou Provimento 89/2016 que regulamentava esse fluxo; campo mantido por compatibilidade."
        },
        "dataFimEficacia": {
          "type": "string",
          "format": "date",
          "description": "Data final de eficacia da Certidao Eletronica. Ver dataInicioEficacia."
        },
        "indCertidaoEletronica": {
          "type": "boolean",
          "description": "Indica certidao eletronica. No XML 2.00 so aceitava 'S' (presente)."
        },
        "indAtoEletronico": {
          "type": "boolean",
          "description": "Indica ato eletronico (gera URLs/hashes). Substitui IndAtoEletronico 'S'/'N'."
        },
        "urlPdfAto": { "type": "string", "format": "uri", "minLength": 2, "maxLength": 2083 },
        "hashPdfAto": { "type": "string", "pattern": "^[A-Fa-f0-9]{64}$" },
        "urlDossie": { "type": "string", "format": "uri", "minLength": 2, "maxLength": 2083 },
        "hashDossie": { "type": "string", "pattern": "^[A-Fa-f0-9]{64}$" }
      }
    },

    "TransmissaoBase": {
      "type": "object",
      "title": "Campos comuns de transmissao nao selada",
      "description": "Campos compartilhados por transmissoes nao seladas (categoria=TRANSMISSAO_NAO_SELADA). Substitui o complexType Transmissao do XSD 2.00.",
      "properties": {
        "categoria": {
          "type": "string",
          "const": "TRANSMISSAO_NAO_SELADA"
        },
        "dataPratica": { "type": "string", "format": "date" },
        "cct": {
          "type": "string",
          "pattern": "^[A-Z]{4}\\d{5}$",
          "description": "Codigo de Controle de Transmissao (CCT). Mesmo formato do selo."
        },
        "indAtoEletronico": { "type": "boolean" },
        "urlPdfAto": { "type": "string", "format": "uri", "minLength": 2, "maxLength": 2083 },
        "hashPdfAto": { "type": "string", "pattern": "^[A-Fa-f0-9]{64}$" },
        "urlDossie": { "type": "string", "format": "uri", "minLength": 2, "maxLength": 2083 },
        "hashDossie": { "type": "string", "pattern": "^[A-Fa-f0-9]{64}$" }
      }
    },

    "ReferenciaAto": {
      "type": "object",
      "title": "Referencia a outro ato",
      "description": "Agrupamento dos campos coesos CodServicoAto* / SeloAto* / AleatorioAto* do XML 2.00.",
      "additionalProperties": false,
      "properties": {
        "codigoServico": { "type": "string", "pattern": "^\\d{1,5}$" },
        "selo": { "type": "string", "pattern": "^[A-Z]{3,4}\\d{5}$", "description": "Selo do ato referenciado (FormatoSeloOriginal: 8 ou 9 caracteres)." },
        "aleatorio": { "type": "string", "pattern": "^[A-Z]{3}$" }
      }
    },

    "Pessoa": {
      "type": "object",
      "title": "Pessoa fisica",
      "description": "Pessoa fisica no contexto de Interdicoes e Tutelas. Substitui tpPessoaFisica do XSD 2.00.",
      "additionalProperties": false,
      "required": ["nome"],
      "properties": {
        "nome": { "type": "string", "minLength": 2, "maxLength": 250 },
        "sexo": { "$ref": "#/$defs/Sexo" },
        "dataNascimento": { "type": "string", "format": "date" },
        "cpf": { "type": "string", "pattern": "^\\d{11}$", "description": "CPF apenas digitos (11). Mascara de apresentacao removida na carga." },
        "justificativaAusenciaCpf": { "$ref": "#/$defs/JustificativaAusenciaCpf" },
        "numeroIdentidade": { "type": "string", "minLength": 1, "maxLength": 25 },
        "orgaoEmissor": { "type": "string", "minLength": 2, "maxLength": 70 },
        "filiacao": {
          "type": "array",
          "minItems": 1,
          "maxItems": 4,
          "description": "Filiacao da pessoa. Substitui tpFiliacao do XSD 2.00 (1..2 Genitor); ate 4 entradas para casos pos-CNJ 73/2018.",
          "items": { "$ref": "#/$defs/Genitor" }
        }
      }
    },

    "Genitor": {
      "type": "object",
      "title": "Genitor",
      "description": "Detalhamento de filiacao. Substitui tpGenitor do XSD 2.00.",
      "additionalProperties": false,
      "required": ["nome"],
      "properties": {
        "tipoFiliacao": { "$ref": "#/$defs/TipoFiliacao" },
        "nome": { "type": "string", "minLength": 2, "maxLength": 250 },
        "sexo": { "$ref": "#/$defs/Sexo" }
      }
    },

    "PessoaJuridica": {
      "type": "object",
      "title": "Pessoa juridica",
      "description": "Pessoa juridica participante (ex.: empresa interditada por insolvencia/falencia). Substitui tpPessoaJuridica do XSD 2.00.",
      "additionalProperties": false,
      "required": ["nome"],
      "properties": {
        "nome": { "type": "string", "minLength": 2, "maxLength": 250 },
        "cnpj": { "type": "string", "pattern": "^\\d{14}$", "description": "CNPJ apenas digitos (14)." },
        "justificativaAusenciaCnpj": { "$ref": "#/$defs/JustificativaAusenciaCnpj" }
      }
    },

    "Interditando": {
      "type": "object",
      "title": "Interditando (PF ou PJ)",
      "description": "Pessoa cuja capacidade civil esta sendo limitada (curatela), tutelado, ausente, insolvente, falido, recuperando judicial. Composicao discriminada de Pessoa ou PessoaJuridica via campo tipoInterditado.",
      "additionalProperties": false,
      "required": ["tipoInterditado"],
      "properties": {
        "tipoInterditado": {
          "type": "string",
          "enum": ["PESSOA_FISICA", "PESSOA_JURIDICA"],
          "description": "Discrimina entre interditado pessoa fisica (PF) e pessoa juridica (PJ)."
        },
        "pessoaFisica": { "$ref": "#/$defs/Pessoa" },
        "pessoaJuridica": { "$ref": "#/$defs/PessoaJuridica" }
      },
      "oneOf": [
        { "required": ["tipoInterditado", "pessoaFisica"], "properties": { "tipoInterditado": { "const": "PESSOA_FISICA" } } },
        { "required": ["tipoInterditado", "pessoaJuridica"], "properties": { "tipoInterditado": { "const": "PESSOA_JURIDICA" } } }
      ]
    },

    "Participantes": {
      "type": "array",
      "title": "Participantes",
      "description": "Colecao de participantes do ato (PF e/ou PJ). Substitui tpParticipantes do XSD 2.00.",
      "minItems": 1,
      "items": { "$ref": "#/$defs/Participante" }
    },

    "Participante": {
      "type": "object",
      "title": "Participante (PF ou PJ)",
      "description": "Item de participante: discrimina entre pessoa fisica e juridica.",
      "additionalProperties": false,
      "required": ["tipoParticipante"],
      "properties": {
        "tipoParticipante": {
          "type": "string",
          "enum": ["PESSOA_FISICA", "PESSOA_JURIDICA"]
        },
        "pessoaFisica": { "$ref": "#/$defs/Pessoa" },
        "pessoaJuridica": { "$ref": "#/$defs/PessoaJuridica" }
      },
      "oneOf": [
        { "required": ["tipoParticipante", "pessoaFisica"], "properties": { "tipoParticipante": { "const": "PESSOA_FISICA" } } },
        { "required": ["tipoParticipante", "pessoaJuridica"], "properties": { "tipoParticipante": { "const": "PESSOA_JURIDICA" } } }
      ]
    },

    "AtosVinculados": {
      "type": "array",
      "title": "Atos vinculados",
      "description": "Colecao de atos vinculados ao ato corrente. Substitui tpAtosVinculados do XSD 2.00.",
      "minItems": 1,
      "items": { "$ref": "#/$defs/AtoVinculado" }
    },

    "AtoVinculado": {
      "type": "object",
      "title": "Ato vinculado",
      "description": "Vinculo a outro ato. Em Interdicoes, dois tipos: ATO_COMPLEMENTO_EMOLUMENTOS (M) e ATO_REFERENCIA (R).",
      "additionalProperties": false,
      "required": ["tipoVinculo"],
      "properties": {
        "tipoVinculo": { "$ref": "#/$defs/TipoVinculo" },
        "codigoServico": { "type": "string", "pattern": "^\\d{1,5}$" },
        "codigoServicoCns": { "type": "string", "pattern": "^\\d{1,6}$", "description": "Codigo Nacional de Serventias (CNJ)." },
        "selo": { "type": "string", "pattern": "^[A-Z]{3,4}\\d{5}$" },
        "aleatorio": { "type": "string", "pattern": "^[A-Z]{3}$" },
        "tipoSelo": { "$ref": "#/$defs/TipoSelo" },
        "cct": { "type": "string", "pattern": "^[A-Z]{4}\\d{5}$" },
        "seloOutroEstado": { "type": "string", "minLength": 1, "maxLength": 50 },
        "dataPratica": { "type": "string", "format": "date" },
        "nomeServico": { "type": "string", "minLength": 2, "maxLength": 250 },
        "estadoServico": { "type": "string", "minLength": 2, "maxLength": 2, "description": "Sigla UF (2 letras)." },
        "numeroProtocolo": { "type": "string", "minLength": 2, "maxLength": 25 }
      }
    },

    "Emolumentos": {
      "type": "object",
      "title": "Emolumentos",
      "description": "Emolumentos do ato. Quando tipoCobranca em {JUSTICA_GRATUITA, SEM_COBRANCA}, valores e itens devem ser suprimidos (validacao de negocio).",
      "additionalProperties": false,
      "required": ["tipoCobranca"],
      "properties": {
        "tipoCobranca": { "$ref": "#/$defs/TipoCobranca" },
        "hipossuficiente": { "type": "boolean" },
        "valorTotalEmolumentos": { "type": "string", "pattern": "^\\d+\\.\\d{2}$" },
        "fetj": { "type": "string", "pattern": "^\\d+\\.\\d{2}$" },
        "fundperj": { "type": "string", "pattern": "^\\d+\\.\\d{2}$" },
        "funperj": { "type": "string", "pattern": "^\\d+\\.\\d{2}$" },
        "funarpen": { "type": "string", "pattern": "^\\d+\\.\\d{2}$" },
        "ressag": { "type": "string", "pattern": "^\\d+\\.\\d{2}$" },
        "valorMutua": { "type": "string", "pattern": "^\\d+\\.\\d{2}$" },
        "valorAcoterj": { "type": "string", "pattern": "^\\d+\\.\\d{2}$" },
        "valorDistribuidor": { "type": "string", "pattern": "^\\d+\\.\\d{2}$" },
        "valorSeloEletronico": { "type": "string", "pattern": "^\\d+\\.\\d{2}$" },
        "valorIss": { "type": "string", "pattern": "^\\d+\\.\\d{2}$" },
        "itens": {
          "type": "array",
          "minItems": 0,
          "maxItems": 100,
          "items": { "$ref": "#/$defs/ItemEmolumento" }
        }
      }
    },

    "ItemEmolumento": {
      "type": "object",
      "title": "Item de emolumento",
      "description": "Item da tabela de emolumentos CGJ-RJ. tabela/item/subItem preservados como string (chaves externas).",
      "additionalProperties": false,
      "required": ["tabela", "item", "quantidade"],
      "properties": {
        "ano": { "type": "integer", "minimum": 2000, "maximum": 2099 },
        "tabela": { "type": "string", "minLength": 1, "maxLength": 8 },
        "item": { "type": "string", "minLength": 1, "maxLength": 20 },
        "subItem": { "type": "string", "minLength": 1, "maxLength": 20 },
        "quantidade": { "type": "integer", "minimum": 1, "maximum": 9999 },
        "complemento": { "type": "string", "minLength": 2, "maxLength": 200 },
        "excecao": { "type": "string", "minLength": 2, "maxLength": 200 }
      }
    },

    "Sexo": {
      "type": "string",
      "enum": ["FEMININO", "MASCULINO", "NAO_BINARIE", "IGNORADO"],
      "description": "Sexo declarado. Fonte: Provimento CNJ 73/2018 (NAO_BINARIE como categoria). F=FEMININO, M=MASCULINO, X=NAO_BINARIE, I=IGNORADO."
    },

    "TipoFiliacao": {
      "type": "string",
      "enum": ["MAE", "PAI", "GENITOR"],
      "description": "Vinculo do genitor. M=MAE, P=PAI, G=GENITOR (familias homoparentais pos-Provimento CNJ 73/2018)."
    },

    "JustificativaAusenciaCpf": {
      "type": "string",
      "enum": ["NAO_POSSUI", "NAO_DECLARADO", "ESTRANGEIRO"],
      "description": "Motivo de ausencia de CPF. 1=NAO_POSSUI, 2=NAO_DECLARADO, 3=ESTRANGEIRO."
    },

    "JustificativaAusenciaCnpj": {
      "type": "string",
      "enum": ["NAO_POSSUI", "NAO_DECLARADO"],
      "description": "Motivo de ausencia de CNPJ. 1=NAO_POSSUI, 2=NAO_DECLARADO."
    },

    "TipoCobranca": {
      "type": "string",
      "enum": ["JUSTICA_GRATUITA", "COM_COBRANCA", "SEM_COBRANCA", "NIHIL"],
      "description": "Modalidade de cobranca dos emolumentos. JG=JUSTICA_GRATUITA, CC=COM_COBRANCA, SC=SEM_COBRANCA (correcao por erro material), NH=NIHIL. Fonte: Manual MAS CGJ-RJ + Lei 6.281/2012 art. 2."
    },

    "TipoVinculo": {
      "type": "string",
      "enum": ["ATO_COMPLEMENTO_EMOLUMENTOS", "ATO_REFERENCIA"],
      "description": "Tipo de vinculo entre o ato corrente e outro ato. M=ATO_COMPLEMENTO_EMOLUMENTOS, R=ATO_REFERENCIA."
    },

    "TipoSelo": {
      "type": "string",
      "enum": ["FISICO", "ELETRONICO"],
      "description": "Modalidade do selo do ato vinculado. F=FISICO (Casa da Moeda), E=ELETRONICO (SFE)."
    },

    "TipoRegistroInterdicao": {
      "type": "string",
      "enum": [
        "SENTENCA_DECLARATORIA",
        "TERMO_TUTELA",
        "TERMO_CURATELA",
        "TERMO_CAUCAO_GARANTIA_TUTELA_CURATELA",
        "ALVARA_PRECATORIO_INCAPAZ",
        "EMANCIPACAO_ORDEM_JUDICIAL",
        "EMANCIPACAO_ESCRITURA",
        "CONTRATO_TUTELADO_CURATELADO",
        "REGISTRO_AUSENCIA",
        "INSOLVENCIA_CIVIL",
        "RECUPERACAO_JUDICIAL_FALENCIA",
        "CURATELA_ORDEM_JUDICIAL",
        "TUTELA_ORDEM_JUDICIAL",
        "OUTRO_ATO_SENTENCA_SUJEITA_REGISTRO",
        "SENTENCA_TUTELA",
        "SENTENCA_CURATELA"
      ],
      "description": "Tipo de registro de interdicao/tutela. Mapeia I1..I16 do XSD 2.00. Fonte: PDF Layout RIT 2.00 Sec.5.4 + Codigo Civil arts. 1.767-1.783 + Lei 13.146/2015 (Estatuto da Pessoa com Deficiencia)."
    },

    "TipoRegistroProcessoAdministrativo": {
      "type": "string",
      "enum": [
        "AVERBACAO",
        "RETIFICACAO",
        "TRANSCRICAO",
        "CANCELAMENTO",
        "RESTAURACAO",
        "OUTROS"
      ],
      "description": "Tipo de registro do Processo Administrativo. Mapeia P1..P5 e P7 do XSD 2.00 (P6 nao alocado no XSD). Fonte: PDF Layout RIT 2.00 Sec.5.7."
    },

    "TipoRegistroCRC": {
      "type": "string",
      "enum": [
        "NASCIMENTO",
        "OBITO",
        "CASAMENTO",
        "TRANSCRICAO_NASCIMENTO",
        "TRANSCRICAO_OBITO",
        "TRANSCRICAO_CASAMENTO",
        "LIVRO_E",
        "INTERDICAO_TUTELA",
        "CERTIDAO_GENERICA_RCPN",
        "CERTIDAO_GENERICA_INTERDICAO_TUTELA"
      ],
      "description": "Tipo de registro da Certidao CRC. Mapeia CN, CO, CC, CNT, COT, CCT, CLE, CIT, CGRCPN, CGIT do XSD 2.00. Fonte: PDF Layout RIT 2.00 Sec.5.8."
    },

    "TipoRegistroLivroE": {
      "type": "string",
      "enum": [
        "SENTENCA_SEPARACAO_JUDICIAL",
        "SENTENCA_DIVORCIO",
        "RESTABELECIMENTO_SOCIEDADE_CONJUGAL",
        "ESCRITURA_SEPARACAO",
        "ESCRITURA_DIVORCIO",
        "OPCAO_NACIONALIDADE",
        "OUTRO_ATO_SENTENCA_REGISTRO",
        "TERMO_TUTELA_CURATELA"
      ],
      "description": "Tipo de registro/averbacao do Livro E. Mapeia E1..E8 do XSD 2.00. Fonte: PDF Layout RIT 2.00 Sec.5.10/5.12."
    },

    "ResultadoCertidaoGenerica": {
      "type": "string",
      "enum": ["POSITIVO", "NEGATIVO", "NEGATIVO_COM_EFEITO_POSITIVO"],
      "description": "Resultado da Certidao Generica. P=POSITIVO, N=NEGATIVO, E=NEGATIVO_COM_EFEITO_POSITIVO."
    },

    "RegistroInterdicaoTutela": {
      "title": "Registro de Interdicao e Tutela",
      "description": "Registro de Interdicao e Tutela. Compreende sentencas de interdicao/curatela, termos de tutela e curatela, emancipacao (judicial ou por escritura), insolvencia civil, recuperacao judicial e falencia, registro de ausencia. Substitui AtoRegistroInterdicaoTutela do XSD 2.00.",
      "allOf": [
        { "$ref": "#/$defs/AtoBase" },
        {
          "type": "object",
          "additionalProperties": false,
          "required": ["categoria", "dataPratica", "selo", "aleatorio", "tipoRegistro", "interditando", "emolumentos"],
          "properties": {
            "categoria": { "const": "ATO_SELADO" },
            "dataPratica": { "type": "string", "format": "date" },
            "selo": { "type": "string", "pattern": "^[A-Z]{4}\\d{5}$" },
            "aleatorio": { "type": "string", "pattern": "^[A-Z]{3}$" },
            "atoOriginal": { "$ref": "#/$defs/ReferenciaAto" },
            "atoReferencia": { "$ref": "#/$defs/ReferenciaAto" },
            "livro": { "type": "string", "minLength": 1, "maxLength": 25 },
            "folha": { "type": "string", "minLength": 1, "maxLength": 25 },
            "termo": { "type": "integer", "minimum": 0, "maximum": 9999999999 },
            "matriculaNacional": { "type": "string", "pattern": "^\\d{32}$" },
            "tipoLivro": { "type": "string", "pattern": "^[1-9]$" },
            "ordemJudicial": { "type": "boolean" },
            "numeroProcessoJudicial": { "type": "string", "minLength": 1, "maxLength": 25 },
            "dataSentencaDecisao": { "type": "string", "format": "date" },
            "dataInicioEficacia": { "type": "string", "format": "date" },
            "dataFimEficacia": { "type": "string", "format": "date" },
            "indCertidaoEletronica": { "type": "boolean" },
            "indAtoEletronico": { "type": "boolean" },
            "urlPdfAto": { "type": "string", "format": "uri", "minLength": 2, "maxLength": 2083 },
            "hashPdfAto": { "type": "string", "pattern": "^[A-Fa-f0-9]{64}$" },
            "urlDossie": { "type": "string", "format": "uri", "minLength": 2, "maxLength": 2083 },
            "hashDossie": { "type": "string", "pattern": "^[A-Fa-f0-9]{64}$" },
            "tipoRegistro": { "$ref": "#/$defs/TipoRegistroInterdicao" },
            "dataCasamento": {
              "type": "string",
              "format": "date",
              "description": "Data do casamento do interditado. Aplicavel apenas a interditando pessoa fisica."
            },
            "processo": {
              "type": "string",
              "minLength": 2,
              "maxLength": 25,
              "description": "Numero do processo judicial. Atributo opcional para tipoRegistro=EMANCIPACAO_ORDEM_JUDICIAL."
            },
            "juizo": {
              "type": "string",
              "minLength": 2,
              "maxLength": 250,
              "description": "Nome da Vara de origem. Atributo opcional para tipoRegistro=EMANCIPACAO_ORDEM_JUDICIAL."
            },
            "comarca": {
              "type": "integer",
              "minimum": 1,
              "maximum": 9999,
              "description": "Codigo da Comarca (Tabela de Referencia 5 - Comarcas). Atributo opcional para tipoRegistro=EMANCIPACAO_ORDEM_JUDICIAL."
            },
            "livroEscritura": {
              "type": "string",
              "minLength": 2,
              "maxLength": 25,
              "description": "Codigo e numero do livro da escritura. Requerido para tipoRegistro=EMANCIPACAO_ESCRITURA."
            },
            "folhaEscritura": {
              "type": "string",
              "minLength": 2,
              "maxLength": 25,
              "description": "Numero da folha da escritura. Requerido para tipoRegistro=EMANCIPACAO_ESCRITURA."
            },
            "dataEscritura": {
              "type": "string",
              "format": "date",
              "description": "Data da escritura. Requerida para tipoRegistro=EMANCIPACAO_ESCRITURA."
            },
            "tutorCurador": {
              "type": "string",
              "minLength": 2,
              "maxLength": 250,
              "description": "Nome do tutor/curador. Requerido para tipoRegistro=TERMO_TUTELA ou TERMO_CURATELA. Em caso de mais de um, sufixar 'e outros'."
            },
            "interditando": { "$ref": "#/$defs/Interditando" },
            "emolumentos": { "$ref": "#/$defs/Emolumentos" }
          }
        }
      ]
    },

    "CertidaoInterdicaoTutela": {
      "title": "Certidao de Interdicao e Tutela",
      "description": "Certidao positiva, negativa, de inteiro teor ou de acervo de interdicao/tutela. Substitui AtoCertidaoInterdicaoTutela do XSD 2.00.",
      "allOf": [
        { "$ref": "#/$defs/AtoBase" },
        {
          "type": "object",
          "additionalProperties": false,
          "required": ["categoria", "dataPratica", "selo", "aleatorio", "emolumentos"],
          "properties": {
            "categoria": { "const": "ATO_SELADO" },
            "dataPratica": { "type": "string", "format": "date" },
            "selo": { "type": "string", "pattern": "^[A-Z]{4}\\d{5}$" },
            "aleatorio": { "type": "string", "pattern": "^[A-Z]{3}$" },
            "atoOriginal": { "$ref": "#/$defs/ReferenciaAto" },
            "atoReferencia": { "$ref": "#/$defs/ReferenciaAto" },
            "livro": { "type": "string", "minLength": 1, "maxLength": 25 },
            "folha": { "type": "string", "minLength": 1, "maxLength": 25 },
            "termo": { "type": "integer", "minimum": 0, "maximum": 9999999999 },
            "matriculaNacional": { "type": "string", "pattern": "^\\d{32}$" },
            "tipoLivro": { "type": "string", "pattern": "^[1-9]$" },
            "ordemJudicial": { "type": "boolean" },
            "numeroProcessoJudicial": { "type": "string", "minLength": 1, "maxLength": 25 },
            "dataSentencaDecisao": { "type": "string", "format": "date" },
            "dataInicioEficacia": { "type": "string", "format": "date" },
            "dataFimEficacia": { "type": "string", "format": "date" },
            "indCertidaoEletronica": { "type": "boolean" },
            "indAtoEletronico": { "type": "boolean" },
            "urlPdfAto": { "type": "string", "format": "uri", "minLength": 2, "maxLength": 2083 },
            "hashPdfAto": { "type": "string", "pattern": "^[A-Fa-f0-9]{64}$" },
            "urlDossie": { "type": "string", "format": "uri", "minLength": 2, "maxLength": 2083 },
            "hashDossie": { "type": "string", "pattern": "^[A-Fa-f0-9]{64}$" },
            "interditando": { "$ref": "#/$defs/Interditando" },
            "emolumentos": { "$ref": "#/$defs/Emolumentos" }
          }
        }
      ]
    },

    "AverbacaoInterdicaoTutela": {
      "title": "Averbacao de Interdicao e Tutela",
      "description": "Averbacao em registro de interdicao/tutela (ex.: levantamento de interdicao, destituicao de tutor, alteracao de extensao). Substitui AtoAverbacaoInterdicaoTutela do XSD 2.00.",
      "allOf": [
        { "$ref": "#/$defs/AtoBase" },
        {
          "type": "object",
          "additionalProperties": false,
          "required": ["categoria", "dataPratica", "selo", "aleatorio", "tipoAverbacao", "emolumentos"],
          "properties": {
            "categoria": { "const": "ATO_SELADO" },
            "dataPratica": { "type": "string", "format": "date" },
            "selo": { "type": "string", "pattern": "^[A-Z]{4}\\d{5}$" },
            "aleatorio": { "type": "string", "pattern": "^[A-Z]{3}$" },
            "atoOriginal": { "$ref": "#/$defs/ReferenciaAto" },
            "atoReferencia": { "$ref": "#/$defs/ReferenciaAto" },
            "livro": { "type": "string", "minLength": 1, "maxLength": 25 },
            "folha": { "type": "string", "minLength": 1, "maxLength": 25 },
            "termo": { "type": "integer", "minimum": 0, "maximum": 9999999999 },
            "matriculaNacional": { "type": "string", "pattern": "^\\d{32}$" },
            "tipoLivro": { "type": "string", "pattern": "^[1-9]$" },
            "ordemJudicial": { "type": "boolean" },
            "numeroProcessoJudicial": { "type": "string", "minLength": 1, "maxLength": 25 },
            "dataSentencaDecisao": { "type": "string", "format": "date" },
            "dataInicioEficacia": { "type": "string", "format": "date" },
            "dataFimEficacia": { "type": "string", "format": "date" },
            "indCertidaoEletronica": { "type": "boolean" },
            "indAtoEletronico": { "type": "boolean" },
            "urlPdfAto": { "type": "string", "format": "uri", "minLength": 2, "maxLength": 2083 },
            "hashPdfAto": { "type": "string", "pattern": "^[A-Fa-f0-9]{64}$" },
            "urlDossie": { "type": "string", "format": "uri", "minLength": 2, "maxLength": 2083 },
            "hashDossie": { "type": "string", "pattern": "^[A-Fa-f0-9]{64}$" },
            "tipoAverbacao": { "$ref": "#/$defs/TipoRegistroInterdicao" },
            "interditando": { "$ref": "#/$defs/Interditando" },
            "emolumentos": { "$ref": "#/$defs/Emolumentos" }
          }
        }
      ]
    },

    "ProcessoAdministrativo": {
      "title": "Processo Administrativo",
      "description": "Processo administrativo extrajudicial (averbacao, retificacao, transcricao, cancelamento, restauracao). Substitui AtoProcessoAdministrativo do XSD 2.00.",
      "allOf": [
        { "$ref": "#/$defs/AtoBase" },
        {
          "type": "object",
          "additionalProperties": false,
          "required": ["categoria", "dataPratica", "selo", "aleatorio", "tipoRegistro", "participantes", "emolumentos"],
          "properties": {
            "categoria": { "const": "ATO_SELADO" },
            "dataPratica": { "type": "string", "format": "date" },
            "selo": { "type": "string", "pattern": "^[A-Z]{4}\\d{5}$" },
            "aleatorio": { "type": "string", "pattern": "^[A-Z]{3}$" },
            "atoOriginal": { "$ref": "#/$defs/ReferenciaAto" },
            "atoReferencia": { "$ref": "#/$defs/ReferenciaAto" },
            "livro": { "type": "string", "minLength": 1, "maxLength": 25 },
            "folha": { "type": "string", "minLength": 1, "maxLength": 25 },
            "termo": { "type": "integer", "minimum": 0, "maximum": 9999999999 },
            "matriculaNacional": { "type": "string", "pattern": "^\\d{32}$" },
            "tipoLivro": { "type": "string", "pattern": "^[1-9]$" },
            "ordemJudicial": { "type": "boolean" },
            "numeroProcessoJudicial": { "type": "string", "minLength": 1, "maxLength": 25 },
            "dataSentencaDecisao": { "type": "string", "format": "date" },
            "indCertidaoEletronica": { "type": "boolean" },
            "indAtoEletronico": { "type": "boolean" },
            "urlPdfAto": { "type": "string", "format": "uri", "minLength": 2, "maxLength": 2083 },
            "hashPdfAto": { "type": "string", "pattern": "^[A-Fa-f0-9]{64}$" },
            "urlDossie": { "type": "string", "format": "uri", "minLength": 2, "maxLength": 2083 },
            "hashDossie": { "type": "string", "pattern": "^[A-Fa-f0-9]{64}$" },
            "tipoRegistro": { "$ref": "#/$defs/TipoRegistroProcessoAdministrativo" },
            "participantes": { "$ref": "#/$defs/Participantes" },
            "emolumentos": { "$ref": "#/$defs/Emolumentos" }
          }
        }
      ]
    },

    "CertidaoCRC": {
      "title": "Certidao da Central de Registros e Certidoes (CRC)",
      "description": "Certidao emitida pela CRC abrangendo registros civis e de interdicao. Substitui AtoCertidaoCRC do XSD 2.00.",
      "allOf": [
        { "$ref": "#/$defs/AtoBase" },
        {
          "type": "object",
          "additionalProperties": false,
          "required": ["categoria", "dataPratica", "selo", "aleatorio", "tipoRegistro", "participantes", "emolumentos"],
          "properties": {
            "categoria": { "const": "ATO_SELADO" },
            "dataPratica": { "type": "string", "format": "date" },
            "selo": { "type": "string", "pattern": "^[A-Z]{4}\\d{5}$" },
            "aleatorio": { "type": "string", "pattern": "^[A-Z]{3}$" },
            "atoOriginal": { "$ref": "#/$defs/ReferenciaAto" },
            "atoReferencia": { "$ref": "#/$defs/ReferenciaAto" },
            "livro": { "type": "string", "minLength": 1, "maxLength": 25 },
            "folha": { "type": "string", "minLength": 1, "maxLength": 25 },
            "termo": { "type": "integer", "minimum": 0, "maximum": 9999999999 },
            "matriculaNacional": { "type": "string", "pattern": "^\\d{32}$" },
            "tipoLivro": { "type": "string", "pattern": "^[1-9]$" },
            "ordemJudicial": { "type": "boolean" },
            "numeroProcessoJudicial": { "type": "string", "minLength": 1, "maxLength": 25 },
            "dataSentencaDecisao": { "type": "string", "format": "date" },
            "dataInicioEficacia": { "type": "string", "format": "date" },
            "dataFimEficacia": { "type": "string", "format": "date" },
            "indCertidaoEletronica": { "type": "boolean" },
            "indAtoEletronico": { "type": "boolean" },
            "urlPdfAto": { "type": "string", "format": "uri", "minLength": 2, "maxLength": 2083 },
            "hashPdfAto": { "type": "string", "pattern": "^[A-Fa-f0-9]{64}$" },
            "urlDossie": { "type": "string", "format": "uri", "minLength": 2, "maxLength": 2083 },
            "hashDossie": { "type": "string", "pattern": "^[A-Fa-f0-9]{64}$" },
            "tipoRegistro": { "$ref": "#/$defs/TipoRegistroCRC" },
            "participantes": { "$ref": "#/$defs/Participantes" },
            "emolumentos": { "$ref": "#/$defs/Emolumentos" }
          }
        }
      ]
    },

    "CertidaoCRCNacional": {
      "title": "Certidao CRC Nacional",
      "description": "Certidao emitida pela CRC Nacional para atos praticados em outro estado. Substitui AtoCertidaoCRCNacional do XSD 2.00.",
      "allOf": [
        { "$ref": "#/$defs/AtoBase" },
        {
          "type": "object",
          "additionalProperties": false,
          "required": ["categoria", "dataPratica", "selo", "aleatorio", "tipoRegistro", "participantes", "emolumentos"],
          "properties": {
            "categoria": { "const": "ATO_SELADO" },
            "dataPratica": { "type": "string", "format": "date" },
            "selo": { "type": "string", "pattern": "^[A-Z]{4}\\d{5}$" },
            "aleatorio": { "type": "string", "pattern": "^[A-Z]{3}$" },
            "atoOriginal": { "$ref": "#/$defs/ReferenciaAto" },
            "atoReferencia": { "$ref": "#/$defs/ReferenciaAto" },
            "livro": { "type": "string", "minLength": 1, "maxLength": 25 },
            "folha": { "type": "string", "minLength": 1, "maxLength": 25 },
            "termo": { "type": "integer", "minimum": 0, "maximum": 9999999999 },
            "matriculaNacional": { "type": "string", "pattern": "^\\d{32}$" },
            "tipoLivro": { "type": "string", "pattern": "^[1-9]$" },
            "ordemJudicial": { "type": "boolean" },
            "numeroProcessoJudicial": { "type": "string", "minLength": 1, "maxLength": 25 },
            "dataSentencaDecisao": { "type": "string", "format": "date" },
            "dataInicioEficacia": { "type": "string", "format": "date" },
            "dataFimEficacia": { "type": "string", "format": "date" },
            "indCertidaoEletronica": { "type": "boolean" },
            "indAtoEletronico": { "type": "boolean" },
            "urlPdfAto": { "type": "string", "format": "uri", "minLength": 2, "maxLength": 2083 },
            "hashPdfAto": { "type": "string", "pattern": "^[A-Fa-f0-9]{64}$" },
            "urlDossie": { "type": "string", "format": "uri", "minLength": 2, "maxLength": 2083 },
            "hashDossie": { "type": "string", "pattern": "^[A-Fa-f0-9]{64}$" },
            "tipoRegistro": { "$ref": "#/$defs/TipoRegistroCRC" },
            "participantes": { "$ref": "#/$defs/Participantes" },
            "atosVinculados": { "$ref": "#/$defs/AtosVinculados" },
            "emolumentos": { "$ref": "#/$defs/Emolumentos" }
          }
        }
      ]
    },

    "RegistroLivroE": {
      "title": "Registro de Livro E",
      "description": "Registro no Livro E (Registros Especiais): separacao judicial, divorcio, restabelecimento de sociedade conjugal, escrituras, opcao de nacionalidade, termo de tutela e curatela. Substitui AtoRegistroLivroE do XSD 2.00.",
      "allOf": [
        { "$ref": "#/$defs/AtoBase" },
        {
          "type": "object",
          "additionalProperties": false,
          "required": ["categoria", "dataPratica", "selo", "aleatorio", "tipoRegistro", "participantes", "emolumentos"],
          "properties": {
            "categoria": { "const": "ATO_SELADO" },
            "dataPratica": { "type": "string", "format": "date" },
            "selo": { "type": "string", "pattern": "^[A-Z]{4}\\d{5}$" },
            "aleatorio": { "type": "string", "pattern": "^[A-Z]{3}$" },
            "atoOriginal": { "$ref": "#/$defs/ReferenciaAto" },
            "atoReferencia": { "$ref": "#/$defs/ReferenciaAto" },
            "livro": { "type": "string", "minLength": 1, "maxLength": 25 },
            "folha": { "type": "string", "minLength": 1, "maxLength": 25 },
            "termo": { "type": "integer", "minimum": 0, "maximum": 9999999999 },
            "matriculaNacional": { "type": "string", "pattern": "^\\d{32}$" },
            "tipoLivro": { "type": "string", "pattern": "^[1-9]$" },
            "ordemJudicial": { "type": "boolean" },
            "numeroProcessoJudicial": { "type": "string", "minLength": 1, "maxLength": 25 },
            "dataSentencaDecisao": { "type": "string", "format": "date" },
            "indCertidaoEletronica": { "type": "boolean" },
            "indAtoEletronico": { "type": "boolean" },
            "urlPdfAto": { "type": "string", "format": "uri", "minLength": 2, "maxLength": 2083 },
            "hashPdfAto": { "type": "string", "pattern": "^[A-Fa-f0-9]{64}$" },
            "urlDossie": { "type": "string", "format": "uri", "minLength": 2, "maxLength": 2083 },
            "hashDossie": { "type": "string", "pattern": "^[A-Fa-f0-9]{64}$" },
            "tipoRegistro": { "$ref": "#/$defs/TipoRegistroLivroE" },
            "processo": { "type": "string", "minLength": 2, "maxLength": 25, "description": "Numero do processo. Requerido para tipoRegistro em {SENTENCA_SEPARACAO_JUDICIAL, SENTENCA_DIVORCIO, OPCAO_NACIONALIDADE, TERMO_TUTELA_CURATELA}." },
            "juizo": { "type": "string", "minLength": 2, "maxLength": 250 },
            "comarca": { "type": "integer", "minimum": 1, "maximum": 9999 },
            "participantes": { "$ref": "#/$defs/Participantes" },
            "emolumentos": { "$ref": "#/$defs/Emolumentos" }
          }
        }
      ]
    },

    "CertidaoLivroE": {
      "title": "Certidao de Livro E",
      "description": "Certidao de ato registrado no Livro E. Substitui AtoCertidaoLivroE do XSD 2.00.",
      "allOf": [
        { "$ref": "#/$defs/AtoBase" },
        {
          "type": "object",
          "additionalProperties": false,
          "required": ["categoria", "dataPratica", "selo", "aleatorio", "participantes", "emolumentos"],
          "properties": {
            "categoria": { "const": "ATO_SELADO" },
            "dataPratica": { "type": "string", "format": "date" },
            "selo": { "type": "string", "pattern": "^[A-Z]{4}\\d{5}$" },
            "aleatorio": { "type": "string", "pattern": "^[A-Z]{3}$" },
            "atoOriginal": { "$ref": "#/$defs/ReferenciaAto" },
            "atoReferencia": { "$ref": "#/$defs/ReferenciaAto" },
            "livro": { "type": "string", "minLength": 1, "maxLength": 25 },
            "folha": { "type": "string", "minLength": 1, "maxLength": 25 },
            "termo": { "type": "integer", "minimum": 0, "maximum": 9999999999 },
            "matriculaNacional": { "type": "string", "pattern": "^\\d{32}$" },
            "tipoLivro": { "type": "string", "pattern": "^[1-9]$" },
            "ordemJudicial": { "type": "boolean" },
            "numeroProcessoJudicial": { "type": "string", "minLength": 1, "maxLength": 25 },
            "dataSentencaDecisao": { "type": "string", "format": "date" },
            "dataInicioEficacia": { "type": "string", "format": "date" },
            "dataFimEficacia": { "type": "string", "format": "date" },
            "indCertidaoEletronica": { "type": "boolean" },
            "indAtoEletronico": { "type": "boolean" },
            "urlPdfAto": { "type": "string", "format": "uri", "minLength": 2, "maxLength": 2083 },
            "hashPdfAto": { "type": "string", "pattern": "^[A-Fa-f0-9]{64}$" },
            "urlDossie": { "type": "string", "format": "uri", "minLength": 2, "maxLength": 2083 },
            "hashDossie": { "type": "string", "pattern": "^[A-Fa-f0-9]{64}$" },
            "participantes": { "$ref": "#/$defs/Participantes" },
            "emolumentos": { "$ref": "#/$defs/Emolumentos" }
          }
        }
      ]
    },

    "AverbacaoLivroE": {
      "title": "Averbacao de Livro E",
      "description": "Averbacao em registro do Livro E. Substitui AtoAverbacaoLivroE do XSD 2.00.",
      "allOf": [
        { "$ref": "#/$defs/AtoBase" },
        {
          "type": "object",
          "additionalProperties": false,
          "required": ["categoria", "dataPratica", "selo", "aleatorio", "participantes", "emolumentos"],
          "properties": {
            "categoria": { "const": "ATO_SELADO" },
            "dataPratica": { "type": "string", "format": "date" },
            "selo": { "type": "string", "pattern": "^[A-Z]{4}\\d{5}$" },
            "aleatorio": { "type": "string", "pattern": "^[A-Z]{3}$" },
            "atoOriginal": { "$ref": "#/$defs/ReferenciaAto" },
            "atoReferencia": { "$ref": "#/$defs/ReferenciaAto" },
            "livro": { "type": "string", "minLength": 1, "maxLength": 25 },
            "folha": { "type": "string", "minLength": 1, "maxLength": 25 },
            "termo": { "type": "integer", "minimum": 0, "maximum": 9999999999 },
            "matriculaNacional": { "type": "string", "pattern": "^\\d{32}$" },
            "tipoLivro": { "type": "string", "pattern": "^[1-9]$" },
            "ordemJudicial": { "type": "boolean" },
            "numeroProcessoJudicial": { "type": "string", "minLength": 1, "maxLength": 25 },
            "dataSentencaDecisao": { "type": "string", "format": "date" },
            "indCertidaoEletronica": { "type": "boolean" },
            "indAtoEletronico": { "type": "boolean" },
            "urlPdfAto": { "type": "string", "format": "uri", "minLength": 2, "maxLength": 2083 },
            "hashPdfAto": { "type": "string", "pattern": "^[A-Fa-f0-9]{64}$" },
            "urlDossie": { "type": "string", "format": "uri", "minLength": 2, "maxLength": 2083 },
            "hashDossie": { "type": "string", "pattern": "^[A-Fa-f0-9]{64}$" },
            "tipoAverbacao": { "$ref": "#/$defs/TipoRegistroLivroE" },
            "participantes": { "$ref": "#/$defs/Participantes" },
            "emolumentos": { "$ref": "#/$defs/Emolumentos" }
          }
        }
      ]
    },

    "CertidaoGenerica": {
      "title": "Certidao Generica",
      "description": "Certidao generica de busca em interdicao/tutela. Substitui AtoCertidaoGenerica do XSD 2.00.",
      "allOf": [
        { "$ref": "#/$defs/AtoBase" },
        {
          "type": "object",
          "additionalProperties": false,
          "required": ["categoria", "dataPratica", "selo", "aleatorio", "resultado", "participantes", "emolumentos"],
          "properties": {
            "categoria": { "const": "ATO_SELADO" },
            "dataPratica": { "type": "string", "format": "date" },
            "selo": { "type": "string", "pattern": "^[A-Z]{4}\\d{5}$" },
            "aleatorio": { "type": "string", "pattern": "^[A-Z]{3}$" },
            "atoOriginal": { "$ref": "#/$defs/ReferenciaAto" },
            "atoReferencia": { "$ref": "#/$defs/ReferenciaAto" },
            "livro": { "type": "string", "minLength": 1, "maxLength": 25 },
            "folha": { "type": "string", "minLength": 1, "maxLength": 25 },
            "termo": { "type": "integer", "minimum": 0, "maximum": 9999999999 },
            "matriculaNacional": { "type": "string", "pattern": "^\\d{32}$" },
            "tipoLivro": { "type": "string", "pattern": "^[1-9]$" },
            "ordemJudicial": { "type": "boolean" },
            "numeroProcessoJudicial": { "type": "string", "minLength": 1, "maxLength": 25 },
            "dataSentencaDecisao": { "type": "string", "format": "date" },
            "dataInicioEficacia": { "type": "string", "format": "date" },
            "dataFimEficacia": { "type": "string", "format": "date" },
            "indCertidaoEletronica": { "type": "boolean" },
            "indAtoEletronico": { "type": "boolean" },
            "urlPdfAto": { "type": "string", "format": "uri", "minLength": 2, "maxLength": 2083 },
            "hashPdfAto": { "type": "string", "pattern": "^[A-Fa-f0-9]{64}$" },
            "urlDossie": { "type": "string", "format": "uri", "minLength": 2, "maxLength": 2083 },
            "hashDossie": { "type": "string", "pattern": "^[A-Fa-f0-9]{64}$" },
            "resultado": { "$ref": "#/$defs/ResultadoCertidaoGenerica" },
            "participantes": { "$ref": "#/$defs/Participantes" },
            "emolumentos": { "$ref": "#/$defs/Emolumentos" }
          }
        }
      ]
    },

    "Apostilamento": {
      "title": "Apostilamento",
      "description": "Apostilamento de documento. Substitui AtoApostilamento do XSD 2.00.",
      "allOf": [
        { "$ref": "#/$defs/AtoBase" },
        {
          "type": "object",
          "additionalProperties": false,
          "required": ["categoria", "dataPratica", "selo", "aleatorio", "documento", "apostilador", "documentoApostilador", "participantes", "emolumentos"],
          "properties": {
            "categoria": { "const": "ATO_SELADO" },
            "dataPratica": { "type": "string", "format": "date" },
            "selo": { "type": "string", "pattern": "^[A-Z]{4}\\d{5}$" },
            "aleatorio": { "type": "string", "pattern": "^[A-Z]{3}$" },
            "atoOriginal": { "$ref": "#/$defs/ReferenciaAto" },
            "atoReferencia": { "$ref": "#/$defs/ReferenciaAto" },
            "livro": { "type": "string", "minLength": 1, "maxLength": 25 },
            "folha": { "type": "string", "minLength": 1, "maxLength": 25 },
            "termo": { "type": "integer", "minimum": 0, "maximum": 9999999999 },
            "matriculaNacional": { "type": "string", "pattern": "^\\d{32}$" },
            "tipoLivro": { "type": "string", "pattern": "^[1-9]$" },
            "ordemJudicial": { "type": "boolean" },
            "numeroProcessoJudicial": { "type": "string", "minLength": 1, "maxLength": 25 },
            "dataSentencaDecisao": { "type": "string", "format": "date" },
            "indCertidaoEletronica": { "type": "boolean" },
            "indAtoEletronico": { "type": "boolean" },
            "urlPdfAto": { "type": "string", "format": "uri", "minLength": 2, "maxLength": 2083 },
            "hashPdfAto": { "type": "string", "pattern": "^[A-Fa-f0-9]{64}$" },
            "urlDossie": { "type": "string", "format": "uri", "minLength": 2, "maxLength": 2083 },
            "hashDossie": { "type": "string", "pattern": "^[A-Fa-f0-9]{64}$" },
            "documento": { "type": "string", "minLength": 2, "maxLength": 50, "description": "Descricao do documento apostilado." },
            "apostilador": { "type": "string", "minLength": 2, "maxLength": 50, "description": "Nome do funcionario do cartorio que apostila." },
            "documentoApostilador": { "type": "string", "minLength": 2, "maxLength": 25, "description": "Documento de identificacao do apostilador." },
            "participantes": { "$ref": "#/$defs/Participantes" },
            "emolumentos": { "$ref": "#/$defs/Emolumentos" }
          }
        }
      ]
    },

    "Visto": {
      "title": "Visto de Interdicao e Tutela",
      "description": "Visto/revalidacao de certidao. Substitui AtoVisto do XSD 2.00.",
      "allOf": [
        { "$ref": "#/$defs/AtoBase" },
        {
          "type": "object",
          "additionalProperties": false,
          "required": ["categoria", "dataPratica", "selo", "aleatorio", "revalidada", "participantes", "emolumentos"],
          "properties": {
            "categoria": { "const": "ATO_SELADO" },
            "dataPratica": { "type": "string", "format": "date" },
            "selo": { "type": "string", "pattern": "^[A-Z]{4}\\d{5}$" },
            "aleatorio": { "type": "string", "pattern": "^[A-Z]{3}$" },
            "atoOriginal": { "$ref": "#/$defs/ReferenciaAto" },
            "atoReferencia": { "$ref": "#/$defs/ReferenciaAto" },
            "livro": { "type": "string", "minLength": 1, "maxLength": 25 },
            "folha": { "type": "string", "minLength": 1, "maxLength": 25 },
            "termo": { "type": "integer", "minimum": 0, "maximum": 9999999999 },
            "matriculaNacional": { "type": "string", "pattern": "^\\d{32}$" },
            "tipoLivro": { "type": "string", "pattern": "^[1-9]$" },
            "ordemJudicial": { "type": "boolean" },
            "numeroProcessoJudicial": { "type": "string", "minLength": 1, "maxLength": 25 },
            "dataSentencaDecisao": { "type": "string", "format": "date" },
            "dataInicioEficacia": { "type": "string", "format": "date" },
            "dataFimEficacia": { "type": "string", "format": "date" },
            "indCertidaoEletronica": { "type": "boolean" },
            "indAtoEletronico": { "type": "boolean" },
            "urlPdfAto": { "type": "string", "format": "uri", "minLength": 2, "maxLength": 2083 },
            "hashPdfAto": { "type": "string", "pattern": "^[A-Fa-f0-9]{64}$" },
            "urlDossie": { "type": "string", "format": "uri", "minLength": 2, "maxLength": 2083 },
            "hashDossie": { "type": "string", "pattern": "^[A-Fa-f0-9]{64}$" },
            "revalidada": { "type": "boolean", "description": "Indica se a certidao foi revalidada (Revalidada 'S'/'N' do XSD 2.00)." },
            "participantes": { "$ref": "#/$defs/Participantes" },
            "emolumentos": { "$ref": "#/$defs/Emolumentos" }
          }
        }
      ]
    },

    "EncerramentoLivro": {
      "title": "Encerramento de Livro",
      "description": "Encerramento de livro escriturado pelo servico. Transmissao nao selada. Substitui AtoEncerramentoLivro do XSD 2.00.",
      "allOf": [
        { "$ref": "#/$defs/TransmissaoBase" },
        {
          "type": "object",
          "additionalProperties": false,
          "required": ["categoria", "dataPratica", "cct", "livro", "qtdTotalFolhas", "identificacaoLivro", "dataEncerramento"],
          "properties": {
            "categoria": { "const": "TRANSMISSAO_NAO_SELADA" },
            "dataPratica": { "type": "string", "format": "date" },
            "cct": { "type": "string", "pattern": "^[A-Z]{4}\\d{5}$" },
            "indAtoEletronico": { "type": "boolean" },
            "urlPdfAto": { "type": "string", "format": "uri", "minLength": 2, "maxLength": 2083 },
            "hashPdfAto": { "type": "string", "pattern": "^[A-Fa-f0-9]{64}$" },
            "urlDossie": { "type": "string", "format": "uri", "minLength": 2, "maxLength": 2083 },
            "hashDossie": { "type": "string", "pattern": "^[A-Fa-f0-9]{64}$" },
            "livro": { "type": "string", "minLength": 2, "maxLength": 25 },
            "qtdTotalFolhas": { "type": "integer", "minimum": 1, "maximum": 999999, "description": "Quantidade total de folhas que compoe o livro." },
            "identificacaoLivro": { "type": "string", "minLength": 2, "maxLength": 100 },
            "dataEncerramento": { "type": "string", "format": "date" }
          }
        }
      ]
    },

    "FolhaAdicionalComplemento": {
      "title": "Folha Adicional / Complemento",
      "description": "Complemento de certidao por folhas excedentes. Transmissao nao selada. Substitui tpFolhaAdicionalComplemento do XSD 2.00.",
      "allOf": [
        { "$ref": "#/$defs/TransmissaoBase" },
        {
          "type": "object",
          "additionalProperties": false,
          "required": ["categoria", "dataPratica", "cct", "atoOriginal", "qtdFolhasExcedentes", "emolumentos"],
          "properties": {
            "categoria": { "const": "TRANSMISSAO_NAO_SELADA" },
            "dataPratica": { "type": "string", "format": "date" },
            "cct": { "type": "string", "pattern": "^[A-Z]{4}\\d{5}$" },
            "indAtoEletronico": { "type": "boolean" },
            "urlPdfAto": { "type": "string", "format": "uri", "minLength": 2, "maxLength": 2083 },
            "hashPdfAto": { "type": "string", "pattern": "^[A-Fa-f0-9]{64}$" },
            "urlDossie": { "type": "string", "format": "uri", "minLength": 2, "maxLength": 2083 },
            "hashDossie": { "type": "string", "pattern": "^[A-Fa-f0-9]{64}$" },
            "atoOriginal": {
              "type": "object",
              "additionalProperties": false,
              "required": ["selo", "aleatorio"],
              "properties": {
                "selo": { "type": "string", "pattern": "^[A-Z]{3,4}\\d{5}$" },
                "aleatorio": { "type": "string", "pattern": "^[A-Z]{3}$" }
              }
            },
            "qtdFolhasExcedentes": { "type": "integer", "minimum": 1, "maximum": 999999 },
            "emolumentos": { "$ref": "#/$defs/Emolumentos" }
          }
        }
      ]
    },

    "InformacaoVerbal": {
      "title": "Informacao Verbal",
      "description": "Ato de informacao verbal prestada pelo servico. Transmissao nao selada. Substitui tpInformacaoVerbal do XSD 2.00.",
      "allOf": [
        { "$ref": "#/$defs/TransmissaoBase" },
        {
          "type": "object",
          "additionalProperties": false,
          "required": ["categoria", "dataPratica", "cct", "numeroAto", "nome", "emolumentos"],
          "properties": {
            "categoria": { "const": "TRANSMISSAO_NAO_SELADA" },
            "dataPratica": { "type": "string", "format": "date" },
            "cct": { "type": "string", "pattern": "^[A-Z]{4}\\d{5}$" },
            "indAtoEletronico": { "type": "boolean" },
            "urlPdfAto": { "type": "string", "format": "uri", "minLength": 2, "maxLength": 2083 },
            "hashPdfAto": { "type": "string", "pattern": "^[A-Fa-f0-9]{64}$" },
            "urlDossie": { "type": "string", "format": "uri", "minLength": 2, "maxLength": 2083 },
            "hashDossie": { "type": "string", "pattern": "^[A-Fa-f0-9]{64}$" },
            "numeroAto": { "type": "string", "minLength": 2, "maxLength": 25, "description": "Numero do recibo." },
            "nome": { "type": "string", "minLength": 2, "maxLength": 200, "description": "Nome de quem solicitou a informacao verbal." },
            "emolumentos": { "$ref": "#/$defs/Emolumentos" }
          }
        }
      ]
    },

    "ComplementoEmolumentos": {
      "title": "Complemento de Emolumentos",
      "description": "Complemento de emolumentos a ato anterior. Transmissao nao selada. Substitui AtoComplementoEmolumentos do XSD 2.00.",
      "allOf": [
        { "$ref": "#/$defs/TransmissaoBase" },
        {
          "type": "object",
          "additionalProperties": false,
          "required": ["categoria", "dataPratica", "cct", "atosVinculados", "emolumentos"],
          "properties": {
            "categoria": { "const": "TRANSMISSAO_NAO_SELADA" },
            "dataPratica": { "type": "string", "format": "date" },
            "cct": { "type": "string", "pattern": "^[A-Z]{4}\\d{5}$" },
            "indAtoEletronico": { "type": "boolean" },
            "urlPdfAto": { "type": "string", "format": "uri", "minLength": 2, "maxLength": 2083 },
            "hashPdfAto": { "type": "string", "pattern": "^[A-Fa-f0-9]{64}$" },
            "urlDossie": { "type": "string", "format": "uri", "minLength": 2, "maxLength": 2083 },
            "hashDossie": { "type": "string", "pattern": "^[A-Fa-f0-9]{64}$" },
            "atosVinculados": { "$ref": "#/$defs/AtosVinculados" },
            "emolumentos": { "$ref": "#/$defs/Emolumentos" }
          }
        }
      ]
    },

    "AlteracaoEmolumentos": {
      "type": "object",
      "title": "Alteracao de Emolumentos",
      "description": "Alteracao de emolumentos de ato ja transmitido (selo ou CCT). Operacao especifica - nao usa AtoBase nem TransmissaoBase. Substitui AtoAlteracaoEmolumentos do XSD 2.00.",
      "additionalProperties": false,
      "required": ["categoria", "selo", "emolumentos"],
      "properties": {
        "categoria": { "const": "OPERACAO" },
        "selo": {
          "type": "string",
          "pattern": "^[A-Z]{4}\\d{5}$",
          "description": "Selo ou CCT do ato cujo emolumento sera alterado."
        },
        "emolumentos": { "$ref": "#/$defs/Emolumentos" }
      }
    }

  }
}
