{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "https://layouts.tjrj.jus.br/sfe/maritimos/v3.0.0/layout_schema.json",
  "title": "Layout SFE/Maritimos v3.0.0",
  "description": "Contrato JSON do Selo de Fiscalizacao Eletronico para a atribuicao Contratos Maritimos da CGJ-RJ. Sucessor do Schema_Maritimos_3.00.xsd. Cobre lavratura/certidao/substabelecimento/revogacao de procuracao, escritura (lavratura e certidao), prenotacao e cancelamento, registro, averbacao, certidao, certidao generica, apresentacao de titulo, apostilamento, encerramento de livro, visto, folha adicional, informacao verbal, complemento e alteracao de emolumentos, e desistencia. 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 Maritimos",
      "description": "Envelope canonico de transmissao de atos da atribuicao Contratos Maritimos. Substitui o elemento ContratosMaritimos/Remessa do XML 3.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 (X-Idempotency-Key)."
        },
        "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 3.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, "description": "Nome do software emissor." },
            "versao": { "type": "string", "minLength": 1, "maxLength": 50, "description": "Versao do software emissor." }
          }
        },
        "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 pelo servico (justificativa de ausencia).",
          "items": { "$ref": "#/$defs/JustificativaAusencia" }
        }
      }
    },

    "JustificativaAusencia": {
      "type": "object",
      "title": "Justificativa de ato nao praticado",
      "description": "Substitui JustificativaAtoNaoPraticado do XML 3.00. Indica datas em que o servico nao praticou nenhum ato sujeito a transmissao.",
      "additionalProperties": false,
      "required": ["data"],
      "properties": {
        "data": { "type": "string", "format": "date", "description": "Data em que nenhum ato foi praticado (ISO 8601)." },
        "motivo": { "type": "string", "minLength": 2, "maxLength": 250, "description": "Motivo descritivo (ex.: FERIADO_NACIONAL, RECESSO, AUSENCIA_DEMANDA)." }
      }
    },

    "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": [
            "LAVRATURA_ESCRITURA",
            "CERTIDAO_ESCRITURA",
            "LAVRATURA_PROCURACAO",
            "CERTIDAO_PROCURACAO",
            "SUBSTABELECIMENTO_PROCURACAO",
            "REVOGACAO_PROCURACAO",
            "PRENOTACAO",
            "CANCELAMENTO_PRENOTACAO",
            "REGISTRO",
            "AVERBACAO",
            "CERTIDAO",
            "CERTIDAO_GENERICA",
            "APRESENTACAO_TITULO_EXAME",
            "APOSTILAMENTO",
            "ENCERRAMENTO_LIVRO",
            "VISTO",
            "FOLHA_ADICIONAL_COMPLEMENTO",
            "INFORMACAO_VERBAL",
            "COMPLEMENTO_EMOLUMENTOS",
            "ALTERACAO_EMOLUMENTOS",
            "DESISTENCIA"
          ]
        },
        "dadosAto": { "type": "object" }
      },
      "oneOf": [
        { "properties": { "tipoAto": { "const": "LAVRATURA_ESCRITURA" }, "dadosAto": { "$ref": "#/$defs/LavraturaEscritura" } } },
        { "properties": { "tipoAto": { "const": "CERTIDAO_ESCRITURA" }, "dadosAto": { "$ref": "#/$defs/CertidaoEscritura" } } },
        { "properties": { "tipoAto": { "const": "LAVRATURA_PROCURACAO" }, "dadosAto": { "$ref": "#/$defs/LavraturaProcuracao" } } },
        { "properties": { "tipoAto": { "const": "CERTIDAO_PROCURACAO" }, "dadosAto": { "$ref": "#/$defs/CertidaoProcuracao" } } },
        { "properties": { "tipoAto": { "const": "SUBSTABELECIMENTO_PROCURACAO" }, "dadosAto": { "$ref": "#/$defs/SubstabelecimentoProcuracao" } } },
        { "properties": { "tipoAto": { "const": "REVOGACAO_PROCURACAO" }, "dadosAto": { "$ref": "#/$defs/RevogacaoProcuracao" } } },
        { "properties": { "tipoAto": { "const": "PRENOTACAO" }, "dadosAto": { "$ref": "#/$defs/Prenotacao" } } },
        { "properties": { "tipoAto": { "const": "CANCELAMENTO_PRENOTACAO" }, "dadosAto": { "$ref": "#/$defs/CancelamentoPrenotacao" } } },
        { "properties": { "tipoAto": { "const": "REGISTRO" }, "dadosAto": { "$ref": "#/$defs/Registro" } } },
        { "properties": { "tipoAto": { "const": "AVERBACAO" }, "dadosAto": { "$ref": "#/$defs/Averbacao" } } },
        { "properties": { "tipoAto": { "const": "CERTIDAO" }, "dadosAto": { "$ref": "#/$defs/Certidao" } } },
        { "properties": { "tipoAto": { "const": "CERTIDAO_GENERICA" }, "dadosAto": { "$ref": "#/$defs/CertidaoGenerica" } } },
        { "properties": { "tipoAto": { "const": "APRESENTACAO_TITULO_EXAME" }, "dadosAto": { "$ref": "#/$defs/ApresentacaoTituloExame" } } },
        { "properties": { "tipoAto": { "const": "APOSTILAMENTO" }, "dadosAto": { "$ref": "#/$defs/Apostilamento" } } },
        { "properties": { "tipoAto": { "const": "ENCERRAMENTO_LIVRO" }, "dadosAto": { "$ref": "#/$defs/EncerramentoLivro" } } },
        { "properties": { "tipoAto": { "const": "VISTO" }, "dadosAto": { "$ref": "#/$defs/Visto" } } },
        { "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" } } },
        { "properties": { "tipoAto": { "const": "DESISTENCIA" }, "dadosAto": { "$ref": "#/$defs/Desistencia" } } }
      ]
    },

    "AtoBase": {
      "type": "object",
      "title": "Campos comuns de ato selado",
      "description": "Campos compartilhados por atos selados (categoria=ATO_SELADO). Substitui o complexType Ato do XSD 3.00.",
      "properties": {
        "categoria": { "type": "string", "const": "ATO_SELADO" },
        "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)." },
        "livro": { "type": "string", "minLength": 1, "maxLength": 25, "description": "Identificacao do livro (ex.: E-405)." },
        "folhaInicial": { "type": "string", "minLength": 1, "maxLength": 25, "description": "Numero da folha inicial." },
        "folhaFinal": { "type": "string", "minLength": 1, "maxLength": 25, "description": "Numero da folha final." },
        "numeroAto": { "type": "string", "minLength": 1, "maxLength": 25, "description": "Numero do ato no livro." },
        "localPratica": { "type": "string", "enum": ["SEDE", "FORA_SEDE"], "description": "Local de pratica do ato (S=SEDE, F=FORA_SEDE)." },
        "fichaMatricula": { "type": "string", "minLength": 1, "maxLength": 25, "description": "Numero da ficha/matricula." },
        "numeroProtocolo": { "type": "string", "minLength": 1, "maxLength": 25, "description": "Numero do protocolo." },
        "numeroRecibo": { "type": "string", "minLength": 1, "maxLength": 25, "description": "Numero do recibo." },
        "dataInicioEficacia": { "type": "string", "format": "date", "description": "Data inicial de eficacia (apenas para Certidao Eletronica)." },
        "dataFimEficacia": { "type": "string", "format": "date", "description": "Data final de eficacia (apenas para Certidao Eletronica)." },
        "indCertidaoEletronica": { "type": "boolean", "description": "Indica certidao eletronica. No XML 3.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, "description": "URL publica do PDF do ato (obrigatoria se indAtoEletronico=true)." },
        "hashPdfAto": { "type": "string", "pattern": "^[A-Fa-f0-9]{64}$", "description": "SHA-256 (64 hex) do PDF do ato." },
        "urlDossie": { "type": "string", "format": "uri", "minLength": 2, "maxLength": 2083, "description": "URL publica do dossie do ato eletronico." },
        "hashDossie": { "type": "string", "pattern": "^[A-Fa-f0-9]{64}$", "description": "SHA-256 (64 hex) do dossie." }
      }
    },

    "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 3.00.",
      "properties": {
        "categoria": { "type": "string", "const": "TRANSMISSAO_NAO_SELADA" },
        "dataPratica": { "type": "string", "format": "date", "description": "Data da pratica da transmissao (ISO 8601)." },
        "cct": { "type": "string", "pattern": "^[A-Z]{4}\\d{5}$", "description": "Codigo de Controle de Transmissao (CCT). Mesmo formato do selo." },
        "indAtoEletronico": { "type": "boolean", "description": "Indica ato eletronico." },
        "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}$" }
      }
    },

    "PessoaFisica": {
      "type": "object",
      "title": "Pessoa Fisica (participante)",
      "description": "Dados de pessoa fisica participante do ato. Substitui tpPessoaFisica do XSD 3.00.",
      "additionalProperties": false,
      "required": ["nome"],
      "properties": {
        "tipo": { "type": "integer", "minimum": 0, "maximum": 999, "description": "Codigo do tipo de participante (ver Tabela 2 - Tipos de Participante CGJ-RJ; preservado como integer por ser chave externa)." },
        "nome": { "type": "string", "minLength": 2, "maxLength": 250, "description": "Nome completo da pessoa fisica." },
        "sexo": { "type": "string", "enum": ["FEMININO", "MASCULINO", "NAO_BINARIE", "IGNORADO"], "description": "Sexo declarado. F=FEMININO, M=MASCULINO, X=NAO_BINARIE, I=IGNORADO. Provimento CNJ 73/2018 (NAO_BINARIE)." },
        "dataNascimento": { "type": "string", "format": "date", "description": "Data de nascimento (ISO 8601)." },
        "numeroIdentidade": { "type": "string", "minLength": 1, "maxLength": 25, "description": "Numero do documento de identidade. Obrigatorio quando CPF nao for informado." },
        "orgaoEmissor": { "type": "string", "minLength": 2, "maxLength": 70, "description": "Orgao emissor do documento de identidade." },
        "cpf": { "type": "string", "pattern": "^\\d{11}$", "description": "CPF apenas digitos (11). Mascara e responsabilidade da apresentacao." },
        "justificativaAusenciaCpf": { "type": "string", "enum": ["NAO_POSSUI", "NAO_DECLARADO", "ESTRANGEIRO"], "description": "Motivo de ausencia de CPF. Substitui codigos 1=NAO_POSSUI, 2=NAO_DECLARADO, 3=ESTRANGEIRO." },
        "nacionalidadeOnu": { "type": "integer", "minimum": 1, "maximum": 999, "description": "Codigo de nacionalidade conforme tabela ONU/M49 (1..3 digitos). Preservado como integer." },
        "estadoCivil": { "type": "string", "enum": ["SOLTEIRO", "CASADO", "VIUVO", "SEPARADO_JUDICIALMENTE", "DIVORCIADO", "SEPARADO_CONSENSUALMENTE", "DESQUITADO", "IGNORADO"], "description": "Estado civil. 1=SOLTEIRO, 2=CASADO, 3=VIUVO, 4=SEPARADO_JUDICIALMENTE, 5=DIVORCIADO, 6=SEPARADO_CONSENSUALMENTE, 7=DESQUITADO, 8=IGNORADO." },
        "numeroPreTeste": { "type": "string", "minLength": 1, "maxLength": 25, "description": "Numero da consulta de pre-teste dos dados." }
      }
    },

    "PessoaJuridica": {
      "type": "object",
      "title": "Pessoa Juridica (participante)",
      "description": "Dados de pessoa juridica participante do ato. Substitui tpPessoaJuridica do XSD 3.00.",
      "additionalProperties": false,
      "required": ["nome"],
      "properties": {
        "tipo": { "type": "integer", "minimum": 0, "maximum": 999, "description": "Codigo do tipo de participante (ver Tabela 2 - Tipos de Participante CGJ-RJ)." },
        "nome": { "type": "string", "minLength": 2, "maxLength": 250, "description": "Razao social ou nome empresarial." },
        "cnpj": { "type": "string", "pattern": "^\\d{14}$", "description": "CNPJ apenas digitos (14). Mascara e responsabilidade da apresentacao." },
        "justificativaAusenciaCnpj": { "type": "string", "enum": ["NAO_POSSUI", "NAO_DECLARADO"], "description": "Motivo de ausencia de CNPJ. 1=NAO_POSSUI, 2=NAO_DECLARADO." },
        "nacionalidadeOnu": { "type": "integer", "minimum": 1, "maximum": 999, "description": "Codigo de nacionalidade conforme tabela ONU/M49." }
      }
    },

    "Participantes": {
      "type": "object",
      "title": "Colecao de participantes do ato",
      "description": "Listas opcionais de pessoas fisicas e juridicas participantes. Substitui tpParticipantes do XSD 3.00.",
      "additionalProperties": false,
      "properties": {
        "pessoasFisicas": { "type": "array", "minItems": 0, "items": { "$ref": "#/$defs/PessoaFisica" } },
        "pessoasJuridicas": { "type": "array", "minItems": 0, "items": { "$ref": "#/$defs/PessoaJuridica" } }
      }
    },

    "Embarcacao": {
      "type": "object",
      "title": "Embarcacao",
      "description": "Dados de embarcacao envolvida em ato maritimo (compra e venda, hipoteca naval, fretamento, arrendamento). Substitui tpEmbarcacao do XSD 3.00. Fonte: Lei 7.652/1988 (Lei do Registro de Embarcacoes) art. 3o e seguintes.",
      "additionalProperties": false,
      "required": ["tipoEmbarcacao", "tipoRecolhimento"],
      "properties": {
        "tipoEmbarcacao": {
          "type": "string",
          "enum": ["LANCHA", "JETSKY", "NAVIO", "PLATAFORMA", "REBOCADOR", "BARCA", "BARCACA", "BALSA", "CAIAQUE", "VELEIRO", "CATAMARA", "SAVEIRO", "IATE", "PESQUEIRO", "BOTE", "SUCATA", "EMPURRADOR", "OUTROS"],
          "description": "Tipo da embarcacao (substitui codigos 1..18 do XSD). Fonte: Lei 7.652/1988 art. 10 (classes de embarcacao) e Tabela 22 do Tribunal Maritimo (NORMAM-01)."
        },
        "descricao": { "type": "string", "minLength": 2, "maxLength": 250, "description": "Descricao livre da embarcacao. Obrigatorio quando tipoEmbarcacao=OUTROS." },
        "numeroInscricao": { "type": "string", "minLength": 2, "maxLength": 50, "description": "Numero da inscricao na Marinha (Tribunal Maritimo). Tambem chamado IRM - Inscricao no Registro Maritimo." },
        "numeroProvisao": { "type": "string", "minLength": 2, "maxLength": 25, "description": "Numero da provisao na Marinha." },
        "tipoRecolhimento": { "type": "string", "enum": ["NORMAL", "ISENTO", "FUTURO"], "description": "Tipo do recolhimento do imposto sobre a embarcacao. N=NORMAL, I=ISENTO (inclui imunidade e nao-incidencia), F=FUTURO." },
        "uf": { "type": "string", "minLength": 2, "maxLength": 2, "description": "UF onde se situa a embarcacao." },
        "codigoPaisOnu": { "type": "integer", "minimum": 1, "maximum": 999, "description": "Codigo do pais conforme ONU/M49. Obrigatorio quando a embarcacao estiver em outro pais." },
        "impostoTransmissao": { "type": "string", "minLength": 1, "maxLength": 25, "description": "Numero da guia de recolhimento do imposto de transmissao. Obrigatorio em caso de doacao ou heranca." },
        "cpfCnpjAdquirente": { "type": "string", "pattern": "^\\d{11}$|^\\d{14}$", "description": "CPF (11) ou CNPJ (14) do adquirente da embarcacao na guia." },
        "cpfCnpjCedente": { "type": "string", "pattern": "^\\d{11}$|^\\d{14}$", "description": "CPF (11) ou CNPJ (14) do cedente da embarcacao na guia." },
        "parteTransferida": { "type": "string", "minLength": 1, "maxLength": 25, "description": "Parte ou percentual transferido conforme guia." },
        "valorBem": { "type": "string", "pattern": "^\\d+\\.\\d{2}$", "description": "Valor (em Real) da embarcacao na guia. Decimal com 2 casas como string." }
      }
    },

    "ImovelComum": {
      "type": "object",
      "title": "Atributos comuns de imovel",
      "description": "Atributos comuns ao imovel rural e urbano. Corresponde ao complexType abstrato Imovel do XSD 3.00.",
      "properties": {
        "numeroMatricula": { "type": "string", "minLength": 1, "maxLength": 25, "description": "Numero da matricula no RGI." },
        "numeroInscricao": { "type": "string", "minLength": 1, "maxLength": 25, "description": "Numero da inscricao imobiliaria." },
        "tipoRecolhimento": { "type": "string", "enum": ["NORMAL", "ISENTO", "FUTURO"], "description": "Tipo do recolhimento do imovel. N=NORMAL, I=ISENTO, F=FUTURO." },
        "tipo": { "type": "string", "enum": ["TERRENO", "EDIFICACAO"], "description": "Tipo do imovel quanto a construcao. T=TERRENO, E=EDIFICACAO." },
        "codigoMunicipio": { "type": "integer", "minimum": 1, "maximum": 99999, "description": "Codigo do municipio (Tabela 9 CGJ-RJ; ate 5 digitos)." },
        "municipio": { "type": "string", "minLength": 2, "maxLength": 250, "description": "Nome do municipio. Obrigatorio quando o municipio pertencer a outro estado." },
        "uf": { "type": "string", "minLength": 2, "maxLength": 2, "description": "UF onde se situa o imovel." },
        "impostoTransmissao": { "type": "string", "minLength": 1, "maxLength": 25, "description": "Numero da guia de recolhimento do imposto de transmissao." },
        "cpfCnpjAdquirente": { "type": "string", "pattern": "^\\d{11}$|^\\d{14}$" },
        "cpfCnpjCedente": { "type": "string", "pattern": "^\\d{11}$|^\\d{14}$" },
        "maiorPorcao": { "type": "string", "minLength": 1, "maxLength": 25, "description": "Indicador de maior porcao na guia do imposto de transmissao." },
        "parteTransferida": { "type": "string", "minLength": 1, "maxLength": 25, "description": "Parte ou percentual transferido na guia." },
        "valorBem": { "type": "string", "pattern": "^\\d+\\.\\d{2}$", "description": "Valor (em Real) do imovel na guia." }
      }
    },

    "ImovelRural": {
      "type": "object",
      "title": "Imovel Rural",
      "description": "Imovel rural objeto do ato (especializa Imovel). Substitui tpImovelRural do XSD 3.00.",
      "allOf": [{ "$ref": "#/$defs/ImovelComum" }],
      "additionalProperties": false,
      "required": ["numeroMatricula", "tipoRecolhimento"],
      "properties": {
        "numeroMatricula": { "type": "string", "minLength": 1, "maxLength": 25 },
        "numeroInscricao": { "type": "string", "minLength": 1, "maxLength": 25 },
        "tipoRecolhimento": { "type": "string", "enum": ["NORMAL", "ISENTO", "FUTURO"] },
        "tipo": { "type": "string", "enum": ["TERRENO", "EDIFICACAO"] },
        "codigoMunicipio": { "type": "integer", "minimum": 1, "maximum": 99999 },
        "municipio": { "type": "string", "minLength": 2, "maxLength": 250 },
        "uf": { "type": "string", "minLength": 2, "maxLength": 2 },
        "impostoTransmissao": { "type": "string", "minLength": 1, "maxLength": 25 },
        "cpfCnpjAdquirente": { "type": "string", "pattern": "^\\d{11}$|^\\d{14}$" },
        "cpfCnpjCedente": { "type": "string", "pattern": "^\\d{11}$|^\\d{14}$" },
        "maiorPorcao": { "type": "string", "minLength": 1, "maxLength": 25 },
        "parteTransferida": { "type": "string", "minLength": 1, "maxLength": 25 },
        "valorBem": { "type": "string", "pattern": "^\\d+\\.\\d{2}$" },
        "numeroIncra": { "type": "string", "minLength": 1, "maxLength": 25, "description": "Numero de inscricao no INCRA." },
        "local": { "type": "string", "minLength": 2, "maxLength": 250, "description": "Local do imovel." },
        "area": { "type": "string", "pattern": "^\\d+\\.\\d{2}$", "description": "Area do imovel (decimal com 2 casas, em string)." },
        "unidadeMedida": { "type": "string", "enum": ["METRO", "KILOMETRO", "HECTARE", "ACRE", "ARE", "ALQUEIRE", "CENTIARES", "LEGUA"], "description": "Unidade de medida da area. 1=METRO, 2=KILOMETRO, 3=HECTARE, 4=ACRE, 5=ARE, 6=ALQUEIRE, 7=CENTIARES, 8=LEGUA." },
        "denominacao": { "type": "string", "minLength": 2, "maxLength": 250, "description": "Denominacao do imovel rural." },
        "numeroInscricaoSrf": { "type": "string", "minLength": 1, "maxLength": 25, "description": "Numero da indicacao cadastral na Receita Federal (ITR)." }
      }
    },

    "ImovelUrbano": {
      "type": "object",
      "title": "Imovel Urbano",
      "description": "Imovel urbano objeto do ato (especializa Imovel). Substitui tpImovelUrbano do XSD 3.00.",
      "allOf": [{ "$ref": "#/$defs/ImovelComum" }],
      "additionalProperties": false,
      "required": ["numeroMatricula", "tipoRecolhimento"],
      "properties": {
        "numeroMatricula": { "type": "string", "minLength": 1, "maxLength": 25 },
        "numeroInscricao": { "type": "string", "minLength": 1, "maxLength": 25 },
        "tipoRecolhimento": { "type": "string", "enum": ["NORMAL", "ISENTO", "FUTURO"] },
        "tipo": { "type": "string", "enum": ["TERRENO", "EDIFICACAO"] },
        "codigoMunicipio": { "type": "integer", "minimum": 1, "maximum": 99999 },
        "municipio": { "type": "string", "minLength": 2, "maxLength": 250 },
        "uf": { "type": "string", "minLength": 2, "maxLength": 2 },
        "impostoTransmissao": { "type": "string", "minLength": 1, "maxLength": 25 },
        "cpfCnpjAdquirente": { "type": "string", "pattern": "^\\d{11}$|^\\d{14}$" },
        "cpfCnpjCedente": { "type": "string", "pattern": "^\\d{11}$|^\\d{14}$" },
        "maiorPorcao": { "type": "string", "minLength": 1, "maxLength": 25 },
        "parteTransferida": { "type": "string", "minLength": 1, "maxLength": 25 },
        "valorBem": { "type": "string", "pattern": "^\\d+\\.\\d{2}$" },
        "logradouro": { "type": "string", "minLength": 2, "maxLength": 250 },
        "bairro": { "type": "string", "minLength": 2, "maxLength": 250 }
      }
    },

    "ObjetoSimples": {
      "type": "object",
      "title": "Objeto simples",
      "description": "Objeto generico (descricao + valor). Substitui tpObjeto do XSD 3.00.",
      "additionalProperties": false,
      "required": ["descricao"],
      "properties": {
        "descricao": { "type": "string", "minLength": 2, "maxLength": 250, "description": "Descricao do objeto da escritura." },
        "valor": { "type": "string", "pattern": "^\\d+\\.\\d{2}$", "description": "Valor (em Real) do objeto." }
      }
    },

    "Objetos": {
      "type": "object",
      "title": "Colecao de objetos do ato",
      "description": "Embarcacoes, objetos genericos e imoveis (rurais e urbanos) envolvidos no ato. Substitui tpObjetos do XSD 3.00.",
      "additionalProperties": false,
      "properties": {
        "embarcacoes": { "type": "array", "items": { "$ref": "#/$defs/Embarcacao" } },
        "objetos": { "type": "array", "items": { "$ref": "#/$defs/ObjetoSimples" } },
        "imoveisRurais": { "type": "array", "items": { "$ref": "#/$defs/ImovelRural" } },
        "imoveisUrbanos": { "type": "array", "items": { "$ref": "#/$defs/ImovelUrbano" } }
      }
    },

    "AtoVinculado": {
      "type": "object",
      "title": "Ato vinculado",
      "description": "Vincula este ato a outro ato (registro, prenotacao, certidao, ato com erro material, ato conjunto, complemento de emolumentos, procuracao). Substitui tpAtosVinculados/AtoVinculado do XSD 3.00.",
      "additionalProperties": false,
      "required": ["tipoVinculo"],
      "properties": {
        "tipoVinculo": {
          "type": "string",
          "enum": [
            "ATO_REGISTRO",
            "ATO_PRENOTACAO",
            "ATO_CERTIDAO",
            "ATO_COM_ERRO_MATERIAL",
            "ATO_CONJUNTO",
            "ATO_COMPLEMENTO_EMOLUMENTOS",
            "ATO_PROCURACAO"
          ],
          "description": "Tipo do vinculo (G/P/C/E/J/M/U humanizados). Substitui letras unicas do XSD."
        },
        "codigoServico": { "type": "string", "pattern": "^\\d{1,5}$", "description": "Codigo do servico onde o ato vinculado foi praticado." },
        "selo": { "type": "string", "pattern": "^[A-Z]{3,4}\\d{5}$", "description": "Selo do ato vinculado (FormatoSeloOriginal: 8 ou 9 caracteres)." },
        "aleatorio": { "type": "string", "pattern": "^[A-Z]{3}$" },
        "tipoSelo": { "type": "string", "enum": ["FISICO", "ELETRONICO"], "description": "F=FISICO (adesivo Casa da Moeda), E=ELETRONICO (SFE)." },
        "cct": { "type": "string", "pattern": "^[A-Z]{4}\\d{5}$", "description": "Codigo de Controle de Transmissao do ato vinculado (quando nao selado)." },
        "dataPratica": { "type": "string", "format": "date" },
        "nomeServico": { "type": "string", "minLength": 2, "maxLength": 100, "description": "Nome do servico onde o ato vinculado foi praticado. Obrigatorio quando o servico for de fora do RJ." },
        "estadoServico": { "type": "string", "minLength": 2, "maxLength": 2, "description": "UF do servico vinculado. Obrigatorio quando for fora do RJ." }
      }
    },

    "ItemEmolumento": {
      "type": "object",
      "title": "Item de emolumento",
      "description": "Linha de detalhamento da composicao do emolumento. Substitui ItemEmolumento do XSD 3.00.",
      "additionalProperties": false,
      "required": ["tabela", "item", "quantidade"],
      "properties": {
        "ano": { "type": "integer", "minimum": 1900, "maximum": 9999, "description": "Ano de referencia da tabela. Quando suprimido, considera-se o ano da data de pratica." },
        "tabela": { "type": "string", "minLength": 1, "maxLength": 8, "description": "Codigo da tabela de emolumentos CGJ-RJ (Tabela 1 do MAS). Preservado como string por ser chave externa de reconciliacao financeira." },
        "item": { "type": "string", "minLength": 1, "maxLength": 20, "description": "Item da tabela de emolumentos (preservado)." },
        "subItem": { "type": "string", "maxLength": 20, "description": "Subitem da tabela de emolumentos (preservado)." },
        "quantidade": { "type": "integer", "minimum": 1, "maximum": 9999, "description": "Quantidade de vezes onde foi aplicado o item." },
        "complemento": { "type": "string", "minLength": 2, "maxLength": 200, "description": "Complemento descritivo." },
        "excecao": { "type": "string", "minLength": 2, "maxLength": 200, "description": "Excecao aplicada." }
      }
    },

    "Emolumentos": {
      "type": "object",
      "title": "Emolumentos do ato",
      "description": "Composicao financeira do ato. Quando tipoCobranca esta em {JUSTICA_GRATUITA, SEM_COBRANCA, ATO_CONJUNTO}, todos os valores e itens sao suprimidos. Substitui tpEmolumentos do XSD 3.00.",
      "additionalProperties": false,
      "required": ["tipoCobranca"],
      "properties": {
        "tipoCobranca": {
          "type": "string",
          "enum": ["JUSTICA_GRATUITA", "COM_COBRANCA", "SEM_COBRANCA", "NIHIL", "ATO_CONJUNTO"],
          "description": "Modalidade de cobranca: JG=JUSTICA_GRATUITA, CC=COM_COBRANCA, SC=SEM_COBRANCA (inclui erro material), NH=NIHIL, AC=ATO_CONJUNTO (cotado no ato principal). Fonte: Manual MAS CGJ-RJ + Lei 6.281/2012 art. 2o."
        },
        "hipossuficiente": { "type": "boolean", "description": "Indica se o titular declarou hipossuficiencia. Aplicavel quando tipoCobranca=JUSTICA_GRATUITA." },
        "valorTotalEmolumentos": { "type": "string", "pattern": "^\\d+\\.\\d{2}$", "description": "Valor total dos emolumentos (string decimal com 2 casas)." },
        "fetj": { "type": "string", "pattern": "^\\d+\\.\\d{2}$", "description": "FETJ (Lei 3.217/1999, 20% sobre os emolumentos)." },
        "fundperj": { "type": "string", "pattern": "^\\d+\\.\\d{2}$", "description": "FUNDPERJ (Lei 4.664/2005, 5%)." },
        "funperj": { "type": "string", "pattern": "^\\d+\\.\\d{2}$", "description": "FUNPERJ (Lei Complementar 111/2006, 5%)." },
        "funarpen": { "type": "string", "pattern": "^\\d+\\.\\d{2}$", "description": "FUNARPEN-RJ (4%)." },
        "ressag": { "type": "string", "pattern": "^\\d+\\.\\d{2}$", "description": "RESSAG - Ressarcimento de gratuidade (2%)." },
        "valorDistribuidor": { "type": "string", "pattern": "^\\d+\\.\\d{2}$", "description": "Valor recolhido para o distribuidor (inclui FETJ, FUNDPERJ, FUNPERJ, FUNARPEN, RESSAG)." },
        "valorSeloEletronico": { "type": "string", "pattern": "^\\d+\\.\\d{2}$", "description": "Valor do selo eletronico repassado ao usuario (Lei 9.873/2022 art. 11)." },
        "valorIss": { "type": "string", "pattern": "^\\d+\\.\\d{2}$", "description": "Valor do ISS (Lei Complementar 175/2020)." },
        "itens": {
          "type": "array",
          "minItems": 0,
          "maxItems": 100,
          "description": "Itens de composicao do emolumento.",
          "items": { "$ref": "#/$defs/ItemEmolumento" }
        }
      }
    },

    "DadosProcuracao": {
      "type": "object",
      "title": "Dados da procuracao usada na escritura",
      "description": "Identifica a procuracao que embasa a lavratura/certidao da escritura quando IndPorProcuracao=true. Substitui tpDadosProcuracao do XSD 3.00.",
      "additionalProperties": false,
      "properties": {
        "indLavradoRio": { "type": "boolean", "description": "Indica se a procuracao foi lavrada em servico do RJ." },
        "codigoServicoProcuracao": { "type": "string", "pattern": "^\\d{1,5}$", "description": "Codigo do servico extrajudicial onde a procuracao foi lavrada." },
        "seloProcuracao": { "type": "string", "pattern": "^[A-Z]{3,4}\\d{5}$", "description": "Selo SFE da procuracao (FormatoSeloOriginal: 8 ou 9 caracteres)." },
        "aleatorioProcuracao": { "type": "string", "pattern": "^[A-Z]{3}$" },
        "servicoProcuracao": { "type": "string", "minLength": 2, "maxLength": 250, "description": "Nome do servico onde a procuracao foi lavrada. Obrigatorio quando o servico for de outro estado." },
        "estadoProcuracao": { "type": "string", "minLength": 2, "maxLength": 2, "description": "UF do servico onde a procuracao foi lavrada. Obrigatorio quando for de outro estado." }
      }
    },

    "ProcuracaoOriginal": {
      "type": "object",
      "title": "Referencia a procuracao original",
      "description": "Dados da procuracao original quando o ato corrente for substabelecimento ou revogacao. Substitui tpProcuracaoOriginal do XSD 3.00.",
      "additionalProperties": false,
      "properties": {
        "livroProcOriginal": { "type": "string", "minLength": 1, "maxLength": 25, "description": "Codigo e numero do livro da procuracao original." },
        "folhaInicialProcOriginal": { "type": "string", "minLength": 1, "maxLength": 25 },
        "folhaFinalProcOriginal": { "type": "string", "minLength": 1, "maxLength": 25 },
        "numeroAtoProcOriginal": { "type": "string", "minLength": 1, "maxLength": 25 },
        "indLavradoRio": { "type": "boolean", "description": "Indica se a procuracao original foi lavrada em servico do RJ." },
        "servicoProcOriginal": { "type": "string", "minLength": 2, "maxLength": 250, "description": "Nome da serventia onde foi lavrada a procuracao original. Obrigatorio quando de outro estado." },
        "estadoProcOriginal": { "type": "string", "minLength": 2, "maxLength": 2, "description": "UF da serventia. Obrigatorio quando de fora do RJ." },
        "dataProcOriginal": { "type": "string", "format": "date", "description": "Data de lavratura da procuracao original." },
        "tipoLivroProcOriginal": { "type": "string", "enum": ["PROCURACAO", "ESCRITURA", "MISTO"], "description": "Tipo do livro da procuracao original. P=PROCURACAO, E=ESCRITURA, M=MISTO." },
        "indOutorgadoAusente": { "type": "boolean", "description": "Indica se o outorgado nao estava presente no momento da revogacao. Obrigatorio quando o ato for REVOGACAO_PROCURACAO." },
        "numeroNotificacao": { "type": "string", "minLength": 1, "maxLength": 25, "description": "Numero da notificacao enviada ao outorgado ausente. Obrigatorio quando indOutorgadoAusente=true." }
      }
    },

    "LavraturaEscritura": {
      "type": "object",
      "title": "Lavratura de Escritura (MLE)",
      "description": "Lavratura de escritura publica relacionada a embarcacao (compra e venda, hipoteca naval, fretamento, arrendamento). Substitui Escritura/MLE do XML 3.00.",
      "allOf": [{ "$ref": "#/$defs/AtoBase" }],
      "additionalProperties": false,
      "required": ["categoria", "dataPratica", "selo", "aleatorio", "tipoEscritura", "indAlvaraJudicial", "indPorProcuracao", "indValorDeclarado", "participantes", "emolumentos"],
      "properties": {
        "categoria": { "type": "string", "const": "ATO_SELADO" },
        "dataPratica": { "type": "string", "format": "date" },
        "selo": { "type": "string", "pattern": "^[A-Z]{4}\\d{5}$" },
        "aleatorio": { "type": "string", "pattern": "^[A-Z]{3}$" },
        "livro": { "type": "string", "minLength": 1, "maxLength": 25 },
        "folhaInicial": { "type": "string", "minLength": 1, "maxLength": 25 },
        "folhaFinal": { "type": "string", "minLength": 1, "maxLength": 25 },
        "numeroAto": { "type": "string", "minLength": 1, "maxLength": 25 },
        "localPratica": { "type": "string", "enum": ["SEDE", "FORA_SEDE"] },
        "fichaMatricula": { "type": "string", "minLength": 1, "maxLength": 25 },
        "numeroProtocolo": { "type": "string", "minLength": 1, "maxLength": 25 },
        "numeroRecibo": { "type": "string", "minLength": 1, "maxLength": 25 },
        "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}$" },
        "tipoEscritura": { "type": "integer", "minimum": 1, "maximum": 999, "description": "Codigo do tipo de escritura conforme Tabela 8 - Tipos de Escritura CGJ-RJ. Preservado como integer por ser chave externa." },
        "descricao": { "type": "string", "minLength": 2, "maxLength": 250, "description": "Descricao do tipo de escritura. Obrigatorio quando tipoEscritura corresponder a 'Outros'." },
        "indAlvaraJudicial": { "type": "boolean", "description": "Indica se o ato foi feito atraves de Juizo." },
        "indPorProcuracao": { "type": "boolean", "description": "Indica se o ato foi feito por procuracao ou substabelecimento." },
        "indValorDeclarado": { "type": "boolean", "description": "Indica se a escritura possui valor declarado." },
        "valorDeclarado": { "type": "string", "pattern": "^\\d+\\.\\d{2}$", "description": "Valor declarado na escritura. Obrigatorio quando indValorDeclarado=true." },
        "moeda": { "type": "string", "enum": ["CRUZEIRO", "CRUZEIRO_NOVO", "CRUZADO", "CRUZADO_NOVO", "CRUZEIRO_REAL", "REAL"], "description": "Moeda do valor declarado. Cr$=CRUZEIRO, NCr$=CRUZEIRO_NOVO, Cz$=CRUZADO, NCz$=CRUZADO_NOVO, CR$=CRUZEIRO_REAL, R$=REAL." },
        "dadosProcuracao": { "$ref": "#/$defs/DadosProcuracao" },
        "objetos": { "$ref": "#/$defs/Objetos" },
        "participantes": { "$ref": "#/$defs/Participantes" },
        "atosVinculados": { "type": "array", "minItems": 1, "items": { "$ref": "#/$defs/AtoVinculado" } },
        "emolumentos": { "$ref": "#/$defs/Emolumentos" }
      }
    },

    "CertidaoEscritura": {
      "type": "object",
      "title": "Certidao de Escritura (MCE)",
      "description": "Emissao de certidao de escritura previamente lavrada. Substitui Escritura/MCE do XML 3.00.",
      "allOf": [{ "$ref": "#/$defs/AtoBase" }],
      "additionalProperties": false,
      "required": ["categoria", "dataPratica", "selo", "aleatorio", "tipoEscritura", "indAlvaraJudicial", "indPorProcuracao", "indValorDeclarado", "participantes", "emolumentos"],
      "properties": {
        "categoria": { "type": "string", "const": "ATO_SELADO" },
        "dataPratica": { "type": "string", "format": "date" },
        "selo": { "type": "string", "pattern": "^[A-Z]{4}\\d{5}$" },
        "aleatorio": { "type": "string", "pattern": "^[A-Z]{3}$" },
        "livro": { "type": "string", "minLength": 1, "maxLength": 25 },
        "folhaInicial": { "type": "string", "minLength": 1, "maxLength": 25 },
        "folhaFinal": { "type": "string", "minLength": 1, "maxLength": 25 },
        "numeroAto": { "type": "string", "minLength": 1, "maxLength": 25 },
        "localPratica": { "type": "string", "enum": ["SEDE", "FORA_SEDE"] },
        "fichaMatricula": { "type": "string", "minLength": 1, "maxLength": 25 },
        "numeroProtocolo": { "type": "string", "minLength": 1, "maxLength": 25 },
        "numeroRecibo": { "type": "string", "minLength": 1, "maxLength": 25 },
        "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}$" },
        "tipoEscritura": { "type": "integer", "minimum": 1, "maximum": 999 },
        "descricao": { "type": "string", "minLength": 2, "maxLength": 250 },
        "indAlvaraJudicial": { "type": "boolean" },
        "indPorProcuracao": { "type": "boolean" },
        "indValorDeclarado": { "type": "boolean" },
        "valorDeclarado": { "type": "string", "pattern": "^\\d+\\.\\d{2}$" },
        "moeda": { "type": "string", "enum": ["CRUZEIRO", "CRUZEIRO_NOVO", "CRUZADO", "CRUZADO_NOVO", "CRUZEIRO_REAL", "REAL"] },
        "dadosProcuracao": { "$ref": "#/$defs/DadosProcuracao" },
        "objetos": { "$ref": "#/$defs/Objetos" },
        "participantes": { "$ref": "#/$defs/Participantes" },
        "atosVinculados": { "type": "array", "minItems": 1, "items": { "$ref": "#/$defs/AtoVinculado" } },
        "emolumentos": { "$ref": "#/$defs/Emolumentos" }
      }
    },

    "ProcuracaoBase": {
      "type": "object",
      "title": "Campos comuns dos atos de procuracao",
      "description": "Atributos compartilhados pelos quatro atos de procuracao (lavratura, certidao, substabelecimento, revogacao). Composicao via allOf.",
      "properties": {
        "finalidadeProcuracao": { "type": "string", "enum": ["FINS_PREVIDENCIARIOS", "BENS_MOVEIS_IMOVEIS_VALORES", "COMUM"], "description": "Finalidade da procuracao. 1=FINS_PREVIDENCIARIOS (exclusivamente previdenciarios), 2=BENS_MOVEIS_IMOVEIS_VALORES, 3=COMUM." },
        "tipoLivro": { "type": "string", "enum": ["PROCURACAO", "ESCRITURA", "MISTO"], "description": "Tipo do livro utilizado. P=PROCURACAO, E=ESCRITURA, M=MISTO." },
        "dataVigencia": { "type": "string", "format": "date", "description": "Data final de vigencia da procuracao." }
      }
    },

    "LavraturaProcuracao": {
      "type": "object",
      "title": "Lavratura de Procuracao (MLP)",
      "description": "Lavratura de procuracao em livro proprio. Substitui Procuracao/MLP do XML 3.00.",
      "allOf": [{ "$ref": "#/$defs/AtoBase" }, { "$ref": "#/$defs/ProcuracaoBase" }],
      "additionalProperties": false,
      "required": ["categoria", "dataPratica", "selo", "aleatorio", "tipoLivro", "participantes", "emolumentos"],
      "properties": {
        "categoria": { "type": "string", "const": "ATO_SELADO" },
        "dataPratica": { "type": "string", "format": "date" },
        "selo": { "type": "string", "pattern": "^[A-Z]{4}\\d{5}$" },
        "aleatorio": { "type": "string", "pattern": "^[A-Z]{3}$" },
        "livro": { "type": "string", "minLength": 1, "maxLength": 25 },
        "folhaInicial": { "type": "string", "minLength": 1, "maxLength": 25 },
        "folhaFinal": { "type": "string", "minLength": 1, "maxLength": 25 },
        "numeroAto": { "type": "string", "minLength": 1, "maxLength": 25 },
        "localPratica": { "type": "string", "enum": ["SEDE", "FORA_SEDE"] },
        "fichaMatricula": { "type": "string", "minLength": 1, "maxLength": 25 },
        "numeroProtocolo": { "type": "string", "minLength": 1, "maxLength": 25 },
        "numeroRecibo": { "type": "string", "minLength": 1, "maxLength": 25 },
        "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}$" },
        "finalidadeProcuracao": { "type": "string", "enum": ["FINS_PREVIDENCIARIOS", "BENS_MOVEIS_IMOVEIS_VALORES", "COMUM"] },
        "tipoLivro": { "type": "string", "enum": ["PROCURACAO", "ESCRITURA", "MISTO"] },
        "dataVigencia": { "type": "string", "format": "date" },
        "procuracaoOriginal": { "$ref": "#/$defs/ProcuracaoOriginal" },
        "participantes": { "$ref": "#/$defs/Participantes" },
        "atosVinculados": { "type": "array", "minItems": 1, "items": { "$ref": "#/$defs/AtoVinculado" } },
        "emolumentos": { "$ref": "#/$defs/Emolumentos" }
      }
    },

    "CertidaoProcuracao": {
      "type": "object",
      "title": "Certidao de Procuracao (MCEP)",
      "description": "Emissao de certidao de procuracao previamente lavrada. Substitui Procuracao/MCEP do XML 3.00.",
      "allOf": [{ "$ref": "#/$defs/AtoBase" }, { "$ref": "#/$defs/ProcuracaoBase" }],
      "additionalProperties": false,
      "required": ["categoria", "dataPratica", "selo", "aleatorio", "tipoLivro", "participantes", "emolumentos"],
      "properties": {
        "categoria": { "type": "string", "const": "ATO_SELADO" },
        "dataPratica": { "type": "string", "format": "date" },
        "selo": { "type": "string", "pattern": "^[A-Z]{4}\\d{5}$" },
        "aleatorio": { "type": "string", "pattern": "^[A-Z]{3}$" },
        "livro": { "type": "string", "minLength": 1, "maxLength": 25 },
        "folhaInicial": { "type": "string", "minLength": 1, "maxLength": 25 },
        "folhaFinal": { "type": "string", "minLength": 1, "maxLength": 25 },
        "numeroAto": { "type": "string", "minLength": 1, "maxLength": 25 },
        "localPratica": { "type": "string", "enum": ["SEDE", "FORA_SEDE"] },
        "fichaMatricula": { "type": "string", "minLength": 1, "maxLength": 25 },
        "numeroProtocolo": { "type": "string", "minLength": 1, "maxLength": 25 },
        "numeroRecibo": { "type": "string", "minLength": 1, "maxLength": 25 },
        "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}$" },
        "finalidadeProcuracao": { "type": "string", "enum": ["FINS_PREVIDENCIARIOS", "BENS_MOVEIS_IMOVEIS_VALORES", "COMUM"] },
        "tipoLivro": { "type": "string", "enum": ["PROCURACAO", "ESCRITURA", "MISTO"] },
        "dataVigencia": { "type": "string", "format": "date" },
        "procuracaoOriginal": { "$ref": "#/$defs/ProcuracaoOriginal" },
        "participantes": { "$ref": "#/$defs/Participantes" },
        "atosVinculados": { "type": "array", "minItems": 1, "items": { "$ref": "#/$defs/AtoVinculado" } },
        "emolumentos": { "$ref": "#/$defs/Emolumentos" }
      }
    },

    "SubstabelecimentoProcuracao": {
      "type": "object",
      "title": "Substabelecimento de Procuracao (MSP)",
      "description": "Substabelecimento de procuracao previamente lavrada. Substitui Procuracao/MSP do XML 3.00.",
      "allOf": [{ "$ref": "#/$defs/AtoBase" }, { "$ref": "#/$defs/ProcuracaoBase" }],
      "additionalProperties": false,
      "required": ["categoria", "dataPratica", "selo", "aleatorio", "tipoLivro", "participantes", "emolumentos"],
      "properties": {
        "categoria": { "type": "string", "const": "ATO_SELADO" },
        "dataPratica": { "type": "string", "format": "date" },
        "selo": { "type": "string", "pattern": "^[A-Z]{4}\\d{5}$" },
        "aleatorio": { "type": "string", "pattern": "^[A-Z]{3}$" },
        "livro": { "type": "string", "minLength": 1, "maxLength": 25 },
        "folhaInicial": { "type": "string", "minLength": 1, "maxLength": 25 },
        "folhaFinal": { "type": "string", "minLength": 1, "maxLength": 25 },
        "numeroAto": { "type": "string", "minLength": 1, "maxLength": 25 },
        "localPratica": { "type": "string", "enum": ["SEDE", "FORA_SEDE"] },
        "fichaMatricula": { "type": "string", "minLength": 1, "maxLength": 25 },
        "numeroProtocolo": { "type": "string", "minLength": 1, "maxLength": 25 },
        "numeroRecibo": { "type": "string", "minLength": 1, "maxLength": 25 },
        "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}$" },
        "finalidadeProcuracao": { "type": "string", "enum": ["FINS_PREVIDENCIARIOS", "BENS_MOVEIS_IMOVEIS_VALORES", "COMUM"] },
        "tipoLivro": { "type": "string", "enum": ["PROCURACAO", "ESCRITURA", "MISTO"] },
        "dataVigencia": { "type": "string", "format": "date" },
        "procuracaoOriginal": { "$ref": "#/$defs/ProcuracaoOriginal" },
        "participantes": { "$ref": "#/$defs/Participantes" },
        "atosVinculados": { "type": "array", "minItems": 1, "items": { "$ref": "#/$defs/AtoVinculado" } },
        "emolumentos": { "$ref": "#/$defs/Emolumentos" }
      }
    },

    "RevogacaoProcuracao": {
      "type": "object",
      "title": "Revogacao de Procuracao (MRP)",
      "description": "Revogacao de procuracao previamente lavrada. Substitui Procuracao/MRP do XML 3.00.",
      "allOf": [{ "$ref": "#/$defs/AtoBase" }, { "$ref": "#/$defs/ProcuracaoBase" }],
      "additionalProperties": false,
      "required": ["categoria", "dataPratica", "selo", "aleatorio", "tipoLivro", "participantes", "emolumentos"],
      "properties": {
        "categoria": { "type": "string", "const": "ATO_SELADO" },
        "dataPratica": { "type": "string", "format": "date" },
        "selo": { "type": "string", "pattern": "^[A-Z]{4}\\d{5}$" },
        "aleatorio": { "type": "string", "pattern": "^[A-Z]{3}$" },
        "livro": { "type": "string", "minLength": 1, "maxLength": 25 },
        "folhaInicial": { "type": "string", "minLength": 1, "maxLength": 25 },
        "folhaFinal": { "type": "string", "minLength": 1, "maxLength": 25 },
        "numeroAto": { "type": "string", "minLength": 1, "maxLength": 25 },
        "localPratica": { "type": "string", "enum": ["SEDE", "FORA_SEDE"] },
        "fichaMatricula": { "type": "string", "minLength": 1, "maxLength": 25 },
        "numeroProtocolo": { "type": "string", "minLength": 1, "maxLength": 25 },
        "numeroRecibo": { "type": "string", "minLength": 1, "maxLength": 25 },
        "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}$" },
        "finalidadeProcuracao": { "type": "string", "enum": ["FINS_PREVIDENCIARIOS", "BENS_MOVEIS_IMOVEIS_VALORES", "COMUM"] },
        "tipoLivro": { "type": "string", "enum": ["PROCURACAO", "ESCRITURA", "MISTO"] },
        "dataVigencia": { "type": "string", "format": "date" },
        "procuracaoOriginal": { "$ref": "#/$defs/ProcuracaoOriginal" },
        "participantes": { "$ref": "#/$defs/Participantes" },
        "atosVinculados": { "type": "array", "minItems": 1, "items": { "$ref": "#/$defs/AtoVinculado" } },
        "emolumentos": { "$ref": "#/$defs/Emolumentos" }
      }
    },

    "Prenotacao": {
      "type": "object",
      "title": "Prenotacao",
      "description": "Lancamento de prenotacao no protocolo do servico extrajudicial. Substitui Prenotacao do XML 3.00.",
      "allOf": [{ "$ref": "#/$defs/AtoBase" }],
      "additionalProperties": false,
      "required": ["categoria", "dataPratica", "selo", "aleatorio", "especieTitulo", "indLavradoRio", "emolumentos"],
      "properties": {
        "categoria": { "type": "string", "const": "ATO_SELADO" },
        "dataPratica": { "type": "string", "format": "date" },
        "selo": { "type": "string", "pattern": "^[A-Z]{4}\\d{5}$" },
        "aleatorio": { "type": "string", "pattern": "^[A-Z]{3}$" },
        "livro": { "type": "string", "minLength": 1, "maxLength": 25 },
        "folhaInicial": { "type": "string", "minLength": 1, "maxLength": 25 },
        "folhaFinal": { "type": "string", "minLength": 1, "maxLength": 25 },
        "numeroAto": { "type": "string", "minLength": 1, "maxLength": 25 },
        "localPratica": { "type": "string", "enum": ["SEDE", "FORA_SEDE"] },
        "fichaMatricula": { "type": "string", "minLength": 1, "maxLength": 25 },
        "numeroProtocolo": { "type": "string", "minLength": 1, "maxLength": 25 },
        "numeroRecibo": { "type": "string", "minLength": 1, "maxLength": 25 },
        "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}$" },
        "especieTitulo": {
          "type": "string",
          "enum": ["ESCRITURAS_PUBLICAS", "ESCRITOS_PARTICULARES_AUTORIZADOS", "ATOS_AUTENTICOS_ESTRANGEIROS", "CARTA_SENTENCA", "FORMAL_PARTILHA", "CERTIDOES_MANDATOS_PROCESSO", "DOCUMENTO_EXCLUSIVO_AVERBACAO"],
          "description": "Especie do titulo apresentado para prenotacao (Lei 6.015/1973 art. 221). 1=ESCRITURAS_PUBLICAS, 2=ESCRITOS_PARTICULARES_AUTORIZADOS (em lei), 3=ATOS_AUTENTICOS_ESTRANGEIROS (com forca de instrumento publico), 4=CARTA_SENTENCA, 5=FORMAL_PARTILHA, 6=CERTIDOES_MANDATOS_PROCESSO (extraidos de autos), 7=DOCUMENTO_EXCLUSIVO_AVERBACAO."
        },
        "tipoEscritura": { "type": "integer", "minimum": 1, "maximum": 999, "description": "Codigo do tipo de escritura quando aplicavel (Tabela 8 CGJ-RJ)." },
        "descricao": { "type": "string", "minLength": 2, "maxLength": 250, "description": "Descricao da natureza da escritura." },
        "indLavradoRio": { "type": "boolean", "description": "Indica se o titulo (ato de Notas) foi lavrado em servico do RJ." },
        "objetos": { "$ref": "#/$defs/Objetos" },
        "participantes": { "$ref": "#/$defs/Participantes" },
        "atosVinculados": { "type": "array", "minItems": 1, "items": { "$ref": "#/$defs/AtoVinculado" } },
        "emolumentos": { "$ref": "#/$defs/Emolumentos" }
      }
    },

    "CancelamentoPrenotacao": {
      "type": "object",
      "title": "Cancelamento de Prenotacao",
      "description": "Cancelamento de prenotacao registrada. Substitui CancelamentoPrenotacao do XML 3.00.",
      "allOf": [{ "$ref": "#/$defs/TransmissaoBase" }],
      "additionalProperties": false,
      "required": ["categoria", "dataPratica", "cct", "requerimentoCancelamento", "atosVinculados", "emolumentos"],
      "properties": {
        "categoria": { "type": "string", "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}$" },
        "requerimentoCancelamento": { "type": "string", "minLength": 1, "maxLength": 25, "description": "Numero do requerimento de cancelamento." },
        "atosVinculados": { "type": "array", "minItems": 1, "items": { "$ref": "#/$defs/AtoVinculado" } },
        "emolumentos": { "$ref": "#/$defs/Emolumentos" }
      }
    },

    "Registro": {
      "type": "object",
      "title": "Registro",
      "description": "Registro de ato relacionado a embarcacao (compra e venda, hipoteca naval, etc.) na matricula do imovel/embarcacao. Substitui Registro do XML 3.00.",
      "allOf": [{ "$ref": "#/$defs/AtoBase" }],
      "additionalProperties": false,
      "required": ["categoria", "dataPratica", "selo", "aleatorio", "atosVinculados", "emolumentos"],
      "properties": {
        "categoria": { "type": "string", "const": "ATO_SELADO" },
        "dataPratica": { "type": "string", "format": "date" },
        "selo": { "type": "string", "pattern": "^[A-Z]{4}\\d{5}$" },
        "aleatorio": { "type": "string", "pattern": "^[A-Z]{3}$" },
        "livro": { "type": "string", "minLength": 1, "maxLength": 25 },
        "folhaInicial": { "type": "string", "minLength": 1, "maxLength": 25 },
        "folhaFinal": { "type": "string", "minLength": 1, "maxLength": 25 },
        "numeroAto": { "type": "string", "minLength": 1, "maxLength": 25 },
        "localPratica": { "type": "string", "enum": ["SEDE", "FORA_SEDE"] },
        "fichaMatricula": { "type": "string", "minLength": 1, "maxLength": 25 },
        "numeroProtocolo": { "type": "string", "minLength": 1, "maxLength": 25 },
        "numeroRecibo": { "type": "string", "minLength": 1, "maxLength": 25 },
        "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": { "type": "integer", "minimum": 1, "maximum": 999, "description": "Codigo do tipo de Registro conforme Tabela 11 - Tipos de Registro RI CGJ-RJ. Preservado como integer por ser chave externa." },
        "atosVinculados": { "type": "array", "minItems": 1, "items": { "$ref": "#/$defs/AtoVinculado" } },
        "emolumentos": { "$ref": "#/$defs/Emolumentos" }
      }
    },

    "Averbacao": {
      "type": "object",
      "title": "Averbacao",
      "description": "Averbacao de fato a margem do registro (Lei 6.015/1973 art. 167, II; art. 247; art. 248). Substitui Averbacao do XML 3.00.",
      "allOf": [{ "$ref": "#/$defs/AtoBase" }],
      "additionalProperties": false,
      "required": ["categoria", "dataPratica", "selo", "aleatorio", "tipoAverbacao", "descricaoAverbacao", "atosVinculados", "emolumentos"],
      "properties": {
        "categoria": { "type": "string", "const": "ATO_SELADO" },
        "dataPratica": { "type": "string", "format": "date" },
        "selo": { "type": "string", "pattern": "^[A-Z]{4}\\d{5}$" },
        "aleatorio": { "type": "string", "pattern": "^[A-Z]{3}$" },
        "livro": { "type": "string", "minLength": 1, "maxLength": 25 },
        "folhaInicial": { "type": "string", "minLength": 1, "maxLength": 25 },
        "folhaFinal": { "type": "string", "minLength": 1, "maxLength": 25 },
        "numeroAto": { "type": "string", "minLength": 1, "maxLength": 25 },
        "localPratica": { "type": "string", "enum": ["SEDE", "FORA_SEDE"] },
        "fichaMatricula": { "type": "string", "minLength": 1, "maxLength": 25 },
        "numeroProtocolo": { "type": "string", "minLength": 1, "maxLength": 25 },
        "numeroRecibo": { "type": "string", "minLength": 1, "maxLength": 25 },
        "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": { "type": "integer", "minimum": 1, "maximum": 99, "description": "Codigo do tipo de Averbacao conforme Tabela 12 - Tipos de Averbacao RI CGJ-RJ. Preservado como integer por ser chave externa." },
        "descricaoAverbacao": { "type": "string", "enum": ["COM_CONTEUDO_ECONOMICO", "SEM_CONTEUDO_ECONOMICO"], "description": "Natureza economica da averbacao. 1=COM_CONTEUDO_ECONOMICO, 2=SEM_CONTEUDO_ECONOMICO." },
        "atosVinculados": { "type": "array", "minItems": 1, "items": { "$ref": "#/$defs/AtoVinculado" } },
        "emolumentos": { "$ref": "#/$defs/Emolumentos" }
      }
    },

    "Certidao": {
      "type": "object",
      "title": "Certidao de Registro",
      "description": "Certidao de registro de ato maritimo (extracao do livro do RGI/registro de embarcacoes). Substitui Certidao do XML 3.00.",
      "allOf": [{ "$ref": "#/$defs/AtoBase" }],
      "additionalProperties": false,
      "required": ["categoria", "dataPratica", "selo", "aleatorio", "tipoCertidao", "numeroRegistros", "atosVinculados", "emolumentos"],
      "properties": {
        "categoria": { "type": "string", "const": "ATO_SELADO" },
        "dataPratica": { "type": "string", "format": "date" },
        "selo": { "type": "string", "pattern": "^[A-Z]{4}\\d{5}$" },
        "aleatorio": { "type": "string", "pattern": "^[A-Z]{3}$" },
        "livro": { "type": "string", "minLength": 1, "maxLength": 25 },
        "folhaInicial": { "type": "string", "minLength": 1, "maxLength": 25 },
        "folhaFinal": { "type": "string", "minLength": 1, "maxLength": 25 },
        "numeroAto": { "type": "string", "minLength": 1, "maxLength": 25 },
        "localPratica": { "type": "string", "enum": ["SEDE", "FORA_SEDE"] },
        "fichaMatricula": { "type": "string", "minLength": 1, "maxLength": 25 },
        "numeroProtocolo": { "type": "string", "minLength": 1, "maxLength": 25 },
        "numeroRecibo": { "type": "string", "minLength": 1, "maxLength": 25 },
        "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}$" },
        "tipoCertidao": { "type": "integer", "minimum": 1, "maximum": 99, "description": "Codigo do tipo de Certidao conforme Tabela 13 - Tipos de Certidao RI CGJ-RJ. Preservado como integer por ser chave externa." },
        "numeroRegistros": { "type": "integer", "minimum": 0, "maximum": 999, "description": "Numero de ocorrencias (atos praticados) localizadas para o objeto da certidao." },
        "objetos": { "$ref": "#/$defs/Objetos" },
        "participantes": { "$ref": "#/$defs/Participantes" },
        "atosVinculados": { "type": "array", "minItems": 1, "items": { "$ref": "#/$defs/AtoVinculado" } },
        "emolumentos": { "$ref": "#/$defs/Emolumentos" }
      }
    },

    "CertidaoGenerica": {
      "type": "object",
      "title": "Certidao Generica",
      "description": "Certidao generica (busca, pesquisa). Substitui CertidaoGenerica do XML 3.00.",
      "allOf": [{ "$ref": "#/$defs/AtoBase" }],
      "additionalProperties": false,
      "required": ["categoria", "dataPratica", "selo", "aleatorio", "qtdPaginas", "resultado", "participantes", "emolumentos"],
      "properties": {
        "categoria": { "type": "string", "const": "ATO_SELADO" },
        "dataPratica": { "type": "string", "format": "date" },
        "selo": { "type": "string", "pattern": "^[A-Z]{4}\\d{5}$" },
        "aleatorio": { "type": "string", "pattern": "^[A-Z]{3}$" },
        "livro": { "type": "string", "minLength": 1, "maxLength": 25 },
        "folhaInicial": { "type": "string", "minLength": 1, "maxLength": 25 },
        "folhaFinal": { "type": "string", "minLength": 1, "maxLength": 25 },
        "numeroAto": { "type": "string", "minLength": 1, "maxLength": 25 },
        "localPratica": { "type": "string", "enum": ["SEDE", "FORA_SEDE"] },
        "fichaMatricula": { "type": "string", "minLength": 1, "maxLength": 25 },
        "numeroProtocolo": { "type": "string", "minLength": 1, "maxLength": 25 },
        "numeroRecibo": { "type": "string", "minLength": 1, "maxLength": 25 },
        "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}$" },
        "qtdPaginas": { "type": "integer", "minimum": 1, "maximum": 999999, "description": "Quantidade de paginas da certidao." },
        "resultado": {
          "type": "string",
          "enum": ["POSITIVO", "NEGATIVO", "NEGATIVO_EFEITO_POSITIVO", "INDETERMINADO"],
          "description": "Resultado da pesquisa. P=POSITIVO, N=NEGATIVO, E=NEGATIVO_EFEITO_POSITIVO, I=INDETERMINADO."
        },
        "objetos": { "$ref": "#/$defs/Objetos" },
        "participantes": { "$ref": "#/$defs/Participantes" },
        "atosVinculados": { "type": "array", "minItems": 1, "items": { "$ref": "#/$defs/AtoVinculado" } },
        "emolumentos": { "$ref": "#/$defs/Emolumentos" }
      }
    },

    "ApresentacaoTituloExame": {
      "type": "object",
      "title": "Apresentacao de Titulo para Exame",
      "description": "Apresentacao de titulo para exame e calculo de emolumentos. Substitui ApresentacaoTituloExame do XML 3.00.",
      "allOf": [{ "$ref": "#/$defs/TransmissaoBase" }],
      "additionalProperties": false,
      "required": ["categoria", "dataPratica", "cct", "numeroProtocolo", "participantes", "emolumentos"],
      "properties": {
        "categoria": { "type": "string", "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}$" },
        "numeroProtocolo": { "type": "string", "minLength": 1, "maxLength": 25 },
        "participantes": { "$ref": "#/$defs/Participantes" },
        "atosVinculados": { "type": "array", "minItems": 1, "items": { "$ref": "#/$defs/AtoVinculado" } },
        "emolumentos": { "$ref": "#/$defs/Emolumentos" }
      }
    },

    "Apostilamento": {
      "type": "object",
      "title": "Apostilamento",
      "description": "Aposicao de apostila (Convencao da Haia 1961) em documento maritimo. Substitui Apostilamento do XML 3.00.",
      "allOf": [{ "$ref": "#/$defs/AtoBase" }],
      "additionalProperties": false,
      "required": ["categoria", "dataPratica", "selo", "aleatorio", "documento", "apostilador", "documentoApostilador", "participantes", "emolumentos"],
      "properties": {
        "categoria": { "type": "string", "const": "ATO_SELADO" },
        "dataPratica": { "type": "string", "format": "date" },
        "selo": { "type": "string", "pattern": "^[A-Z]{4}\\d{5}$" },
        "aleatorio": { "type": "string", "pattern": "^[A-Z]{3}$" },
        "livro": { "type": "string", "minLength": 1, "maxLength": 25 },
        "folhaInicial": { "type": "string", "minLength": 1, "maxLength": 25 },
        "folhaFinal": { "type": "string", "minLength": 1, "maxLength": 25 },
        "numeroAto": { "type": "string", "minLength": 1, "maxLength": 25 },
        "localPratica": { "type": "string", "enum": ["SEDE", "FORA_SEDE"] },
        "fichaMatricula": { "type": "string", "minLength": 1, "maxLength": 25 },
        "numeroProtocolo": { "type": "string", "minLength": 1, "maxLength": 25 },
        "numeroRecibo": { "type": "string", "minLength": 1, "maxLength": 25 },
        "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}$" },
        "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 efetua o apostilamento." },
        "documentoApostilador": { "type": "string", "minLength": 2, "maxLength": 25, "description": "Documento de identificacao do apostilador." },
        "participantes": { "$ref": "#/$defs/Participantes" },
        "emolumentos": { "$ref": "#/$defs/Emolumentos" }
      }
    },

    "EncerramentoLivro": {
      "type": "object",
      "title": "Encerramento de Livro",
      "description": "Encerramento de livro contabil/notarial. Substitui EncerramentoLivro do XML 3.00.",
      "allOf": [{ "$ref": "#/$defs/TransmissaoBase" }],
      "additionalProperties": false,
      "required": ["categoria", "dataPratica", "cct", "livro", "qtdTotalFolhas", "identificacaoLivro", "dataEncerramento"],
      "properties": {
        "categoria": { "type": "string", "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": 1, "maxLength": 25, "description": "Codigo e numero do livro encerrado." },
        "qtdTotalFolhas": { "type": "integer", "minimum": 1, "maximum": 999999, "description": "Quantidade total de folhas do livro." },
        "identificacaoLivro": { "type": "string", "minLength": 2, "maxLength": 100, "description": "Identificacao do livro." },
        "dataEncerramento": { "type": "string", "format": "date", "description": "Data efetiva do encerramento do livro." }
      }
    },

    "Visto": {
      "type": "object",
      "title": "Visto",
      "description": "Aposicao de visto/revalidacao em ato extrajudicial. Substitui Visto do XML 3.00.",
      "allOf": [{ "$ref": "#/$defs/AtoBase" }],
      "additionalProperties": false,
      "required": ["categoria", "dataPratica", "selo", "aleatorio", "revalidada", "participantes", "emolumentos"],
      "properties": {
        "categoria": { "type": "string", "const": "ATO_SELADO" },
        "dataPratica": { "type": "string", "format": "date" },
        "selo": { "type": "string", "pattern": "^[A-Z]{4}\\d{5}$" },
        "aleatorio": { "type": "string", "pattern": "^[A-Z]{3}$" },
        "livro": { "type": "string", "minLength": 1, "maxLength": 25 },
        "folhaInicial": { "type": "string", "minLength": 1, "maxLength": 25 },
        "folhaFinal": { "type": "string", "minLength": 1, "maxLength": 25 },
        "numeroAto": { "type": "string", "minLength": 1, "maxLength": 25 },
        "localPratica": { "type": "string", "enum": ["SEDE", "FORA_SEDE"] },
        "fichaMatricula": { "type": "string", "minLength": 1, "maxLength": 25 },
        "numeroProtocolo": { "type": "string", "minLength": 1, "maxLength": 25 },
        "numeroRecibo": { "type": "string", "minLength": 1, "maxLength": 25 },
        "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 o ato foi revalidado." },
        "participantes": { "$ref": "#/$defs/Participantes" },
        "atosVinculados": { "type": "array", "minItems": 1, "items": { "$ref": "#/$defs/AtoVinculado" } },
        "emolumentos": { "$ref": "#/$defs/Emolumentos" }
      }
    },

    "FolhaAdicionalComplemento": {
      "type": "object",
      "title": "Folha Adicional / Complemento",
      "description": "Complemento do ato de Certidao referente a folhas excedentes. Substitui FolhaAdicionalComplemento do XML 3.00.",
      "allOf": [{ "$ref": "#/$defs/TransmissaoBase" }],
      "additionalProperties": false,
      "required": ["categoria", "dataPratica", "cct", "qtdPaginasExcedentes", "emolumentos"],
      "properties": {
        "categoria": { "type": "string", "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}$" },
        "qtdPaginasExcedentes": { "type": "integer", "minimum": 1, "maximum": 999999, "description": "Quantidade de paginas excedentes." },
        "atosVinculados": { "type": "array", "minItems": 1, "items": { "$ref": "#/$defs/AtoVinculado" } },
        "emolumentos": { "$ref": "#/$defs/Emolumentos" }
      }
    },

    "InformacaoVerbal": {
      "type": "object",
      "title": "Informacao Verbal",
      "description": "Ato de informacao verbal solicitada pelo usuario. Substitui InformacaoVerbal do XML 3.00.",
      "allOf": [{ "$ref": "#/$defs/TransmissaoBase" }],
      "additionalProperties": false,
      "required": ["categoria", "dataPratica", "cct", "numeroAto", "nome", "emolumentos"],
      "properties": {
        "categoria": { "type": "string", "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": 1, "maxLength": 25, "description": "Numero do recibo da informacao verbal." },
        "nome": { "type": "string", "minLength": 2, "maxLength": 200, "description": "Nome no qual foi solicitada a informacao verbal." },
        "emolumentos": { "$ref": "#/$defs/Emolumentos" }
      }
    },

    "ComplementoEmolumentos": {
      "type": "object",
      "title": "Complemento de Emolumentos",
      "description": "Complemento de emolumentos de ato anteriormente cotado. Substitui ComplementoEmolumentos do XML 3.00.",
      "allOf": [{ "$ref": "#/$defs/TransmissaoBase" }],
      "additionalProperties": false,
      "required": ["categoria", "dataPratica", "cct", "atosVinculados", "emolumentos"],
      "properties": {
        "categoria": { "type": "string", "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": { "type": "array", "minItems": 1, "items": { "$ref": "#/$defs/AtoVinculado" } },
        "emolumentos": { "$ref": "#/$defs/Emolumentos" }
      }
    },

    "AlteracaoEmolumentos": {
      "type": "object",
      "title": "Alteracao de Emolumentos",
      "description": "Alteracao de emolumentos de ato ja distribuido. Categoria OPERACAO (sem AtoBase nem TransmissaoBase). Substitui AlteracaoEmolumentos do XML 3.00.",
      "additionalProperties": false,
      "required": ["categoria", "selo", "emolumentos"],
      "properties": {
        "categoria": { "type": "string", "const": "OPERACAO", "description": "Operacao administrativa sobre ato existente, sem selo proprio nem CCT." },
        "selo": { "type": "string", "pattern": "^[A-Z]{4}\\d{5}$", "description": "Selo (ou CCT, mesmo formato) do ato cujos emolumentos serao alterados." },
        "emolumentos": { "$ref": "#/$defs/Emolumentos" }
      }
    },

    "Desistencia": {
      "type": "object",
      "title": "Desistencia",
      "description": "Desistencia de ato em curso. Substitui DesistenciaAto do XML 3.00.",
      "allOf": [{ "$ref": "#/$defs/TransmissaoBase" }],
      "additionalProperties": false,
      "required": ["categoria", "dataPratica", "cct", "tipoAtoDesistido", "motivo", "emolumentos"],
      "properties": {
        "categoria": { "type": "string", "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}$" },
        "tipoAtoDesistido": { "type": "string", "minLength": 2, "maxLength": 250, "description": "Descricao livre do tipo do ato objeto da desistencia (ex.: 'Escritura de compra e venda')." },
        "motivo": { "type": "string", "enum": ["FALTA_ASSINATURA", "DESISTENCIA", "OUTROS"], "description": "Motivo da desistencia. 1=FALTA_ASSINATURA, 2=DESISTENCIA, 3=OUTROS." },
        "descricao": { "type": "string", "minLength": 2, "maxLength": 250, "description": "Descricao livre do motivo. Obrigatorio quando motivo=OUTROS." },
        "emolumentos": { "$ref": "#/$defs/Emolumentos" }
      }
    }
  }
}
