{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "https://layouts.tjrj.jus.br/sfe/notas/v3.0.0/layout_schema.json",
  "title": "Layout SFE Notas v3.0.0",
  "description": "Contrato JSON para transmissao de atos do Selo de Fiscalizacao Eletronico — atribuicao Notas (Tabelionato de Notas). Sucessor do XML 2.04 legado. Cobre escrituras publicas, procuracoes, testamentos, atas notariais, reconhecimento de firmas, autenticacao de copias, apostilamento (Convencao da Haia) e operacoes administrativas relacionadas. Fonte normativa: Lei 8.935/1994 (Lei dos Cartorios), Lei 6.015/1973, Provimento CNJ 100/2020 (e-Notariado), Manual MAS CGJ-RJ.",
  "type": "object",
  "additionalProperties": false,
  "required": ["remessa"],
  "properties": {
    "$schema": { "type": "string", "format": "uri" },
    "remessa": {
      "type": "object",
      "additionalProperties": false,
      "required": ["id", "versaoLayout", "codigoServico", "tipoOperacao", "ambiente", "software", "dataGeracao"],
      "properties": {
        "id": { "type": "string", "format": "uuid", "description": "UUID v4. Usado para idempotencia (X-Idempotency-Key)." },
        "versaoLayout": { "type": "string", "pattern": "^\\d+\\.\\d+\\.\\d+$", "description": "Versao semver do layout. 3.0.0 e a primeira em JSON (sucessora do XML 2.04)." },
        "codigoServico": { "type": "string", "pattern": "^\\d{1,5}$", "description": "Codigo do Servico Extrajudicial (CGJ-RJ)." },
        "tipoOperacao": { "$ref": "#/$defs/TipoOperacao" },
        "ambiente": { "$ref": "#/$defs/Ambiente" },
        "software": {
          "type": "object",
          "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", "description": "Instante ISO 8601 com offset (-03:00 RJ)." },
        "atos": {
          "type": "array",
          "maxItems": 5000,
          "items": { "$ref": "#/$defs/Ato" }
        },
        "justificativasAusencia": {
          "type": "array",
          "items": { "$ref": "#/$defs/JustificativaAusencia" }
        }
      }
    }
  },

  "$defs": {

    "TipoOperacao": {
      "type": "string",
      "enum": ["INCLUSAO", "ALTERACAO"],
      "description": "Operacao da remessa. INCLUSAO = novo ato. ALTERACAO = retificacao/cancelamento. Mapeia XML 'I'/'A'."
    },

    "Ambiente": {
      "type": "string",
      "enum": ["HOMOLOGACAO", "PRODUCAO"],
      "description": "Ambiente alvo do envio. Mapeia XML 'HML'/'PRD'."
    },

    "TipoCobranca": {
      "type": "string",
      "enum": ["JUSTICA_GRATUITA", "COM_COBRANCA", "SEM_COBRANCA", "NIHIL", "ATO_CONJUNTO", "PRIMEIRA_AQUISICAO"],
      "description": "Modalidade de cobranca. JG = justica gratuita; CC = com cobranca normal; SC = sem cobranca (isencao por erro material — exige vinculo ao ato anterior); NH = NIHIL (latim juridico, mantido); AC = Ato Conjunto (cotado no ato principal); PA = Primeira Aquisicao (Lei 6.281/2012). Fonte: Manual MAS CGJ-RJ + PDF Layout Notas 2.04 §5.37."
    },

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

    "TipoFiliacao": {
      "type": "string",
      "enum": ["MAE", "PAI"],
      "description": "Tipo de filiacao. Em Notas o XSD legado limita a M/P (sem GENITOR). Mapeia XML M/P."
    },

    "EstadoCivil": {
      "type": "string",
      "enum": ["SOLTEIRO", "CASADO", "VIUVO", "SEPARADO_JUDICIALMENTE", "DIVORCIADO", "SEPARADO_CONSENSUALMENTE", "DESQUITADO", "IGNORADO"],
      "description": "Estado civil. Fonte: Manual MAS CGJ-RJ + PDF Layout Notas 2.04 §5.27. Mapeia XML 1..8."
    },

    "JustificativaAusenciaCpf": {
      "type": "string",
      "enum": ["NAO_POSSUI", "NAO_DECLARADO", "ESTRANGEIRO"],
      "description": "Justificativa para ausencia de CPF. Mapeia XML 1/2/3."
    },

    "JustificativaAusenciaCnpj": {
      "type": "string",
      "enum": ["NAO_POSSUI", "NAO_DECLARADO"],
      "description": "Justificativa para ausencia de CNPJ. Mapeia XML 1/2."
    },

    "TipoSelo": {
      "type": "string",
      "enum": ["FISICO", "ELETRONICO"],
      "description": "Modalidade do selo. F = adesivo Casa da Moeda; E = SFE. Mapeia XML F/E."
    },

    "TipoVinculo": {
      "type": "string",
      "enum": [
        "ATO_ESCRITURA",
        "ATO_CERTIDAO",
        "ATO_TESTAMENTO",
        "ATO_PROCURACAO",
        "ATO_DE_ACERVO",
        "ATO_COM_ERRO_MATERIAL",
        "ATO_ABERTURA_FIRMA",
        "ATO_CONJUNTO",
        "ATO_COMPLEMENTO_EMOLUMENTOS",
        "ATO_TESTAMENTO_REVOGATORIO"
      ],
      "description": "Tipo de vinculo entre o ato corrente e outro ato. Fonte: PDF Layout Notas 2.04 §5.36. Mapeia XML H/C/T/U/A/E/F/J/M/Y."
    },

    "TipoLivroProcuracao": {
      "type": "string",
      "enum": ["PROCURACAO", "ESCRITURA", "MISTO"],
      "description": "Tipo do livro utilizado em ato de Procuracao. Mapeia XML P/E/M. Fonte: PDF §5.5."
    },

    "TipoLocalPratica": {
      "type": "string",
      "enum": ["SEDE", "FORA_DA_SEDE"],
      "description": "Local onde o ato foi praticado. Mapeia XML S/F. Fonte: PDF §5.2."
    },

    "FinalidadeProcuracao": {
      "type": "string",
      "enum": ["PREVIDENCIARIA", "BENS_MOVEIS_IMOVEIS_VALORES", "COMUM"],
      "description": "Finalidade da procuracao. 1=fins exclusivamente previdenciarios; 2=que versem sobre bens moveis, imoveis e valores; 3=comum. Fonte: PDF §5.5."
    },

    "TipoEscritura": {
      "type": "string",
      "enum": ["LAVRATURA_ESCRITURA", "CERTIDAO_ESCRITURA"],
      "description": "Subtipo do ato Escritura. NLE=Lavratura, NCE=Certidao. Mapeia XML NLE/NCE."
    },

    "TipoProcuracao": {
      "type": "string",
      "enum": ["LAVRATURA_PROCURACAO", "CERTIDAO_PROCURACAO", "SUBSTABELECIMENTO_PROCURACAO", "REVOGACAO_PROCURACAO"],
      "description": "Subtipo do ato Procuracao. Mapeia XML NLP/NCP/NSP/NRP."
    },

    "TipoTestamento": {
      "type": "string",
      "enum": ["REGISTRO_TESTAMENTO_PUBLICO", "REGISTRO_TESTAMENTO_CERRADO", "CERTIDAO_TESTAMENTO_PUBLICO", "CERTIDAO_TESTAMENTO_CERRADO", "TESTAMENTO_REVOGATORIO", "CERTIDAO_REVOGACAO_TESTAMENTO"],
      "description": "Subtipo do ato Testamento. Mapeia XML NRTP/NRTC/NCTP/NCTC/NTR/NCTR."
    },

    "TipoFirma": {
      "type": "string",
      "enum": ["ABERTURA_FIRMA", "RECONHECIMENTO_SEMELHANCA", "RECONHECIMENTO_AUTENTICIDADE", "RECONHECIMENTO_CHANCELA", "RECONHECIMENTO_SINAL_PUBLICO"],
      "description": "Subtipo do ato Firma. Mapeia XML NAF/NRFS/NRFA/NRFC/NRFP."
    },

    "TipoAtoNotarialEletronico": {
      "type": "string",
      "enum": ["RECONHECIMENTO_ASSINATURA_ELETRONICA_DOC_DIGITAL", "RECONHECIMENTO_FIRMA_AUTENTICIDADE_VIDEOCONFERENCIA", "AUTORIZACAO_ELETRONICA_VIAGEM", "AUTENTICACAO_DIGITAL_CENAD"],
      "description": "Subtipo do Ato Notarial Eletronico (e-Notariado, Provimento CNJ 100/2020). NRAEDD=e-Not Assina; NRFAV=videoconferencia; NAEV=AEV; NAD=CENAD. Mapeia XML NRAEDD/NRFAV/NAEV/NAD."
    },

    "TipoDocumentoFirma": {
      "type": "string",
      "enum": ["CONTRATOS", "DECLARACAO", "PROCURACAO", "COMPRA_VENDA_VEICULOS_DUT", "OUTROS"],
      "description": "Tipo de documento submetido a reconhecimento de firma. Aplica em NRFS/NRFA. Mapeia XML 1/2/3/4/5. Fonte: PDF §5.7."
    },

    "TipoCertidaoGenerica": {
      "type": "string",
      "enum": ["ESCRITURA", "PROCURACAO", "TESTAMENTO", "FIRMA"],
      "description": "Tipo da certidao generica. Mapeia XML G1/G2/G3/G4. Fonte: PDF §5.12."
    },

    "OrigemDocMaterializacao": {
      "type": "string",
      "enum": ["WEBSITE", "ARQUIVO"],
      "description": "Origem do documento eletronico materializado. Mapeia XML W/A. Fonte: PDF §5.13."
    },

    "MotivoDesistencia": {
      "type": "string",
      "enum": ["FALTA_ASSINATURA", "DESISTENCIA", "OUTROS"],
      "description": "Motivo da desistencia do ato. Mapeia XML 1/2/3. Fonte: PDF §5.22."
    },

    "TipoRecolhimentoImovel": {
      "type": "string",
      "enum": ["NORMAL", "ISENTO", "FUTURO"],
      "description": "Tipo de recolhimento do imposto de transmissao. N=Normal; I=Isento (inclui imunidade e nao-incidencia); F=Futuro. Mapeia XML N/I/F. Fonte: PDF §5.31."
    },

    "TipoConstrucaoImovel": {
      "type": "string",
      "enum": ["TERRENO", "EDIFICACAO"],
      "description": "Tipo do imovel quanto a construcao. Mapeia XML T/E. Fonte: PDF §5.31."
    },

    "TipoImpostoTransmissao": {
      "type": "string",
      "enum": ["ITBI", "ITD"],
      "description": "Imposto de transmissao incidente sobre o imovel. ITBI=Imposto sobre Transmissao de Bens Imoveis; ITD=Imposto sobre Transmissao Causa Mortis e Doacao. Fonte: PDF §5.31."
    },

    "UnidadeMedidaArea": {
      "type": "string",
      "enum": ["METRO", "KILOMETRO", "HECTARE", "ACRE", "ARE", "ALQUEIRE", "CENTIARES", "LEGUA"],
      "description": "Unidade de medida da area do imovel rural. Mapeia XML 1..8. Fonte: PDF §5.33."
    },

    "Moeda": {
      "type": "string",
      "enum": ["CRUZEIRO", "CRUZEIRO_NOVO", "CRUZADO", "CRUZADO_NOVO", "CRUZEIRO_REAL", "REAL"],
      "description": "Moeda do valor declarado na Escritura. Cobre seriado historico (escrituras antigas). Mapeia XML Cr$/NCr$/Cz$/NCz$/CR$/R$. Fonte: PDF §5.4."
    },

    "JustificativaAusencia": {
      "type": "object",
      "title": "JustificativaAusencia",
      "description": "Justificativa de ato nao praticado em determinada data. Permite suprir hiato legal.",
      "additionalProperties": false,
      "required": ["data"],
      "properties": {
        "data": { "type": "string", "format": "date" },
        "motivo": { "type": "string", "minLength": 2, "maxLength": 200, "description": "Motivo opcional. XSD original nao exige; campo livre para auditoria interna." }
      }
    },

    "Pessoa": {
      "type": "object",
      "title": "Pessoa",
      "description": "Pessoa fisica participante de ato notarial (outorgante, outorgado, testador, apresentante, etc.). Papel definido pelo tipoParticipante (chave da tabela CGJ-RJ n° 2).",
      "additionalProperties": false,
      "required": ["nome"],
      "properties": {
        "tipoParticipante": { "type": "string", "pattern": "^\\d{1,3}$", "description": "Codigo do tipo de participante (tabela CGJ-RJ n° 2 — Tipos de Participante). Preservado como string por ser chave externa CGJ-RJ. Ex.: '30'=Adquirente, '31'=Outorgante, '16'=Outorgado, '17'=Outorgante, '40'=Titular, '85'=Substabelecido. Conferir tabela MAS." },
        "nome": { "type": "string", "minLength": 2, "maxLength": 250 },
        "sexo": { "$ref": "#/$defs/Sexo" },
        "dataNascimento": { "type": "string", "format": "date" },
        "numeroIdentidade": { "type": "string", "minLength": 2, "maxLength": 25, "description": "Numero do documento de identidade. Obrigatorio quando o CPF nao for informado." },
        "orgaoEmissor": { "type": "string", "minLength": 2, "maxLength": 70 },
        "cpf": { "type": "string", "pattern": "^\\d{11}$", "description": "CPF apenas digitos (11)." },
        "justificativaAusenciaCpf": { "$ref": "#/$defs/JustificativaAusenciaCpf" },
        "nacionalidadeOnu": { "type": "integer", "minimum": 1, "maximum": 999, "description": "Codigo ONU/M49 de pais/nacionalidade (1..999). Tabela ONU. Brasil=76. Preservado como integer." },
        "estadoCivil": { "$ref": "#/$defs/EstadoCivil" },
        "numeroPreTeste": { "type": "string", "minLength": 2, "maxLength": 25, "description": "Numero de consulta de pre-teste de dados. Exclusivo para ato de Procuracao." },
        "numeroConsultaBib": { "type": "string", "minLength": 2, "maxLength": 25, "description": "Numero de consulta de indisponibilidade de bens (BIB)." },
        "numeroConsultaLei11441": { "type": "string", "minLength": 2, "maxLength": 25, "description": "Numero de consulta de inventario/separacao/divorcio extrajudicial (Lei 11.441/07)." },
        "filiacao": { "$ref": "#/$defs/Filiacao" }
      }
    },

    "PessoaJuridica": {
      "type": "object",
      "title": "PessoaJuridica",
      "description": "Pessoa juridica participante de ato notarial.",
      "additionalProperties": false,
      "required": ["nome"],
      "properties": {
        "tipoParticipante": { "type": "string", "pattern": "^\\d{1,3}$", "description": "Codigo do tipo de participante (tabela CGJ-RJ n° 2). Preservado como string." },
        "nome": { "type": "string", "minLength": 2, "maxLength": 250 },
        "cnpj": { "type": "string", "pattern": "^\\d{14}$", "description": "CNPJ apenas digitos (14)." },
        "justificativaAusenciaCnpj": { "$ref": "#/$defs/JustificativaAusenciaCnpj" },
        "nacionalidadeOnu": { "type": "integer", "minimum": 1, "maximum": 999 },
        "numeroConsultaBib": { "type": "string", "minLength": 2, "maxLength": 25 }
      }
    },

    "Filiacao": {
      "type": "object",
      "title": "Filiacao",
      "description": "Filiacao da pessoa fisica. Maximo 2 genitores conforme XSD legado de Notas (M/P).",
      "additionalProperties": false,
      "required": ["genitores"],
      "properties": {
        "genitores": {
          "type": "array",
          "minItems": 1,
          "maxItems": 2,
          "items": { "$ref": "#/$defs/Genitor" }
        }
      }
    },

    "Genitor": {
      "type": "object",
      "title": "Genitor",
      "additionalProperties": false,
      "required": ["nome"],
      "properties": {
        "tipoFiliacao": { "$ref": "#/$defs/TipoFiliacao" },
        "nome": { "type": "string", "minLength": 2, "maxLength": 250 },
        "sexo": { "$ref": "#/$defs/Sexo" }
      }
    },

    "Participantes": {
      "type": "object",
      "title": "Participantes",
      "description": "Colecao de participantes de um ato notarial. O papel (outorgante, outorgado, etc.) e indicado em Pessoa.tipoParticipante (chave da tabela CGJ-RJ n° 2).",
      "additionalProperties": false,
      "properties": {
        "pessoasFisicas": {
          "type": "array",
          "items": { "$ref": "#/$defs/Pessoa" }
        },
        "pessoasJuridicas": {
          "type": "array",
          "items": { "$ref": "#/$defs/PessoaJuridica" }
        }
      }
    },

    "ImovelRural": {
      "type": "object",
      "title": "ImovelRural",
      "description": "Imovel rural objeto da escritura. Compoe campos Imovel + atributos rurais.",
      "additionalProperties": false,
      "required": ["tipoRecolhimento"],
      "properties": {
        "indicadoCodigoServicoRi": { "type": "string", "minLength": 2, "maxLength": 5 },
        "indicadoNomeServicoRi": { "type": "string", "minLength": 2, "maxLength": 100 },
        "indicadoEstadoServicoRi": { "type": "string", "pattern": "^[A-Z]{2}$" },
        "numeroMatricula": { "type": "string", "minLength": 2, "maxLength": 25 },
        "numeroInscricao": { "type": "string", "minLength": 2, "maxLength": 25 },
        "tipoRecolhimento": { "$ref": "#/$defs/TipoRecolhimentoImovel" },
        "tipoConstrucao": { "$ref": "#/$defs/TipoConstrucaoImovel" },
        "codigoMunicipio": { "type": "string", "minLength": 1, "maxLength": 5, "description": "Codigo do municipio (tabela CGJ-RJ n° 9). Preservado como string por ser chave de tabela." },
        "municipio": { "type": "string", "minLength": 2, "maxLength": 250 },
        "uf": { "type": "string", "pattern": "^[A-Z]{2}$" },
        "tipoImposto": { "$ref": "#/$defs/TipoImpostoTransmissao" },
        "impostoTransmissao": { "type": "string", "minLength": 2, "maxLength": 25 },
        "cpfCnpjAdquirente": { "type": "string", "minLength": 11, "maxLength": 14 },
        "cpfCnpjCedente": { "type": "string", "minLength": 11, "maxLength": 14 },
        "maiorPorcao": { "type": "string", "minLength": 2, "maxLength": 25 },
        "parteTransferida": { "type": "string", "minLength": 2, "maxLength": 25 },
        "valorBem": { "type": "string", "pattern": "^\\d+\\.\\d{2}$" },
        "numeroIncra": { "type": "string", "minLength": 2, "maxLength": 25, "description": "Numero de inscricao no INCRA." },
        "local": { "type": "string", "minLength": 2, "maxLength": 250 },
        "area": { "type": "string", "pattern": "^\\d+\\.\\d{2}$", "description": "Area do imovel rural (decimal com 2 casas, em string para preservar precisao)." },
        "unidadeMedida": { "$ref": "#/$defs/UnidadeMedidaArea" },
        "denominacao": { "type": "string", "minLength": 2, "maxLength": 250 },
        "numeroInscricaoSrf": { "type": "string", "minLength": 2, "maxLength": 25, "description": "Numero da indicacao cadastral na Receita Federal para fins de ITR." }
      }
    },

    "ImovelUrbano": {
      "type": "object",
      "title": "ImovelUrbano",
      "description": "Imovel urbano objeto da escritura.",
      "additionalProperties": false,
      "required": ["tipoRecolhimento"],
      "properties": {
        "indicadoCodigoServicoRi": { "type": "string", "minLength": 2, "maxLength": 5 },
        "indicadoNomeServicoRi": { "type": "string", "minLength": 2, "maxLength": 100 },
        "indicadoEstadoServicoRi": { "type": "string", "pattern": "^[A-Z]{2}$" },
        "numeroMatricula": { "type": "string", "minLength": 2, "maxLength": 25 },
        "numeroInscricao": { "type": "string", "minLength": 2, "maxLength": 25 },
        "tipoRecolhimento": { "$ref": "#/$defs/TipoRecolhimentoImovel" },
        "tipoConstrucao": { "$ref": "#/$defs/TipoConstrucaoImovel" },
        "codigoMunicipio": { "type": "string", "minLength": 1, "maxLength": 5 },
        "municipio": { "type": "string", "minLength": 2, "maxLength": 250 },
        "uf": { "type": "string", "pattern": "^[A-Z]{2}$" },
        "tipoImposto": { "$ref": "#/$defs/TipoImpostoTransmissao" },
        "impostoTransmissao": { "type": "string", "minLength": 2, "maxLength": 25 },
        "cpfCnpjAdquirente": { "type": "string", "minLength": 11, "maxLength": 14 },
        "cpfCnpjCedente": { "type": "string", "minLength": 11, "maxLength": 14 },
        "maiorPorcao": { "type": "string", "minLength": 2, "maxLength": 25 },
        "parteTransferida": { "type": "string", "minLength": 2, "maxLength": 25 },
        "valorBem": { "type": "string", "pattern": "^\\d+\\.\\d{2}$" },
        "logradouro": { "type": "string", "minLength": 2, "maxLength": 250 },
        "bairro": { "type": "string", "minLength": 2, "maxLength": 250 }
      }
    },

    "ObjetoEscritura": {
      "type": "object",
      "title": "ObjetoEscritura",
      "description": "Objeto generico de Escritura nao imobiliario (barco, veiculo, semovente, etc.).",
      "additionalProperties": false,
      "required": ["descricao"],
      "properties": {
        "descricao": { "type": "string", "minLength": 2, "maxLength": 250 },
        "valor": { "type": "string", "pattern": "^\\d+\\.\\d{2}$" }
      }
    },

    "ObjetosEscritura": {
      "type": "object",
      "title": "ObjetosEscritura",
      "description": "Colecao de objetos da Escritura (imoveis rurais, urbanos e objetos diversos).",
      "additionalProperties": false,
      "properties": {
        "imoveisRurais": { "type": "array", "items": { "$ref": "#/$defs/ImovelRural" } },
        "imoveisUrbanos": { "type": "array", "items": { "$ref": "#/$defs/ImovelUrbano" } },
        "objetos": { "type": "array", "items": { "$ref": "#/$defs/ObjetoEscritura" } }
      }
    },

    "DadosProcuracaoEscritura": {
      "type": "object",
      "title": "DadosProcuracaoEscritura",
      "description": "Dados da Procuracao usada para lavratura da Escritura. Aplica quando indPorProcuracao=true.",
      "additionalProperties": false,
      "properties": {
        "lavradoNoRj": { "type": "boolean" },
        "codigoServicoProcuracao": { "type": "string", "pattern": "^\\d{1,5}$" },
        "seloProcuracao": { "type": "string", "pattern": "^[A-Z]{4}\\d{5}$" },
        "aleatorioProcuracao": { "type": "string", "minLength": 3, "maxLength": 10 },
        "servicoProcuracao": { "type": "string", "minLength": 2, "maxLength": 250 },
        "estadoProcuracao": { "type": "string", "pattern": "^[A-Z]{2}$" }
      }
    },

    "ProcuracaoOriginal": {
      "type": "object",
      "title": "ProcuracaoOriginal",
      "description": "Referencia a procuracao original em atos de Substabelecimento (NSP), Revogacao (NRP) ou Certidao (NCP) — quando se tratar de ato antigo sem selo.",
      "additionalProperties": false,
      "properties": {
        "livro": { "type": "string", "minLength": 2, "maxLength": 25 },
        "folhaInicial": { "type": "string", "minLength": 2, "maxLength": 25 },
        "folhaFinal": { "type": "string", "minLength": 2, "maxLength": 25 },
        "numeroAto": { "type": "string", "minLength": 2, "maxLength": 25 },
        "lavradoNoRj": { "type": "boolean" },
        "servico": { "type": "string", "minLength": 2, "maxLength": 250 },
        "estado": { "type": "string", "pattern": "^[A-Z]{2}$" },
        "dataLavratura": { "type": "string", "format": "date" },
        "tipoLivro": { "$ref": "#/$defs/TipoLivroProcuracao" },
        "outorgadoAusente": { "type": "boolean", "description": "Indica se no momento da revogacao o outorgado nao estava presente. Obrigatorio em NRP." },
        "numeroNotificacao": { "type": "string", "minLength": 2, "maxLength": 25 }
      }
    },

    "TestamentoOriginal": {
      "type": "object",
      "title": "TestamentoOriginal",
      "description": "Referencia ao testamento original em Testamento Revogatorio (NTR), Certidao de Testamento Publico (NCTP) ou Cerrado (NCTC).",
      "additionalProperties": false,
      "properties": {
        "livro": { "type": "string", "minLength": 2, "maxLength": 25 },
        "numeroAto": { "type": "string", "minLength": 2, "maxLength": 25 },
        "lavradoNoRj": { "type": "boolean" },
        "servico": { "type": "string", "minLength": 2, "maxLength": 250 },
        "estado": { "type": "string", "pattern": "^[A-Z]{2}$" },
        "dataRegistro": { "type": "string", "format": "date" }
      }
    },

    "AtoVinculado": {
      "type": "object",
      "title": "AtoVinculado",
      "description": "Vinculo a outro ato. Em Notas o conjunto de tipos e fechado a 10 valores (PDF §5.36).",
      "additionalProperties": false,
      "required": ["tipoVinculo"],
      "properties": {
        "tipoVinculo": { "$ref": "#/$defs/TipoVinculo" },
        "codigoServico": { "type": "string", "pattern": "^\\d{1,5}$" },
        "selo": { "type": "string", "pattern": "^[A-Z]{4}\\d{5}$" },
        "aleatorio": { "type": "string", "minLength": 3, "maxLength": 10 },
        "tipoSelo": { "$ref": "#/$defs/TipoSelo" },
        "cct": { "type": "string", "pattern": "^[A-Z]{4}\\d{5}$" },
        "dataPratica": { "type": "string", "format": "date" },
        "nomeServico": { "type": "string", "minLength": 2, "maxLength": 100 },
        "estadoServico": { "type": "string", "pattern": "^[A-Z]{2}$" }
      }
    },

    "ItemEmolumento": {
      "type": "object",
      "title": "ItemEmolumento",
      "description": "Item da tabela de emolumentos CGJ-RJ. tabela/item/subItem sao chaves externas — preservados como string conforme legado.",
      "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", "maxLength": 20 },
        "quantidade": { "type": "integer", "minimum": 1, "maximum": 9999 },
        "complemento": { "type": "string", "minLength": 2, "maxLength": 200 },
        "excecao": { "type": "string", "minLength": 2, "maxLength": 200 }
      }
    },

    "Emolumentos": {
      "type": "object",
      "title": "Emolumentos",
      "description": "Emolumentos do ato. Quando tipoCobranca in {JUSTICA_GRATUITA, SEM_COBRANCA, ATO_CONJUNTO} todos os valores monetarios e itens DEVEM ser suprimidos (PDF §5.37 obs.). Validacao de negocio servidor.",
      "additionalProperties": false,
      "required": ["tipoCobranca"],
      "properties": {
        "tipoCobranca": { "$ref": "#/$defs/TipoCobranca" },
        "valorTotalEmolumentos": { "type": "string", "pattern": "^\\d+\\.\\d{2}$" },
        "fetj": { "type": "string", "pattern": "^\\d+\\.\\d{2}$", "description": "FETJ — Lei 3.217/1999, 20% sobre 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 — Fundo de Apoio aos Registradores Civis das Pessoas Naturais, 4%." },
        "ressag": { "type": "string", "pattern": "^\\d+\\.\\d{2}$", "description": "RESSAG — ressarcimento de gratuidade, 2%." },
        "valorDistribuidor": { "type": "string", "pattern": "^\\d+\\.\\d{2}$" },
        "valorSeloEletronico": { "type": "string", "pattern": "^\\d+\\.\\d{2}$", "description": "Lei 9.873/2022 art. 11." },
        "valorIss": { "type": "string", "pattern": "^\\d+\\.\\d{2}$" },
        "itens": { "type": "array", "maxItems": 100, "items": { "$ref": "#/$defs/ItemEmolumento" } }
      }
    },

    "EscrituraDados": {
      "type": "object",
      "title": "EscrituraDados",
      "description": "Escritura publica notarial — lavratura ou certidao. Inclui compra-venda, doacao, dacao em pagamento, permuta, divorcio extrajudicial, inventario extrajudicial, uniao estavel, pacto antenupcial e demais subtipos da tabela CGJ-RJ n° 8.",
      "additionalProperties": false,
      "required": ["categoria", "dataPratica", "selo", "aleatorio", "tipoEscritura", "codigoTipoEscritura", "indAlvaraJudicial", "indPorProcuracao", "indValorDeclarado", "participantes", "emolumentos"],
      "properties": {
        "categoria": { "const": "ATO_SELADO" },
        "dataPratica": { "type": "string", "format": "date" },
        "selo": { "type": "string", "pattern": "^[A-Z]{4}\\d{5}$" },
        "aleatorio": { "type": "string", "minLength": 3, "maxLength": 10 },
        "livro": { "type": "string", "minLength": 2, "maxLength": 25 },
        "folhaInicial": { "type": "string", "minLength": 2, "maxLength": 25 },
        "folhaFinal": { "type": "string", "minLength": 2, "maxLength": 25 },
        "numeroAto": { "type": "string", "minLength": 2, "maxLength": 25 },
        "localPratica": { "$ref": "#/$defs/TipoLocalPratica" },
        "dataInicioEficacia": { "type": "string", "format": "date" },
        "dataFimEficacia": { "type": "string", "format": "date" },
        "indCertidaoEletronica": { "type": "boolean" },
        "indAtoEletronico": { "type": "boolean" },
        "urlPdfAto": { "type": "string", "format": "uri", "maxLength": 2083 },
        "hashPdfAto": { "type": "string", "pattern": "^[A-Fa-f0-9]{64}$" },
        "urlDossie": { "type": "string", "format": "uri", "maxLength": 2083 },
        "hashDossie": { "type": "string", "pattern": "^[A-Fa-f0-9]{64}$" },
        "matriculaNotarialEletronica": { "type": "string", "minLength": 24, "maxLength": 29 },
        "tipoEscritura": { "$ref": "#/$defs/TipoEscritura" },
        "codigoTipoEscritura": { "type": "string", "pattern": "^\\d{1,3}$", "description": "Codigo do subtipo de escritura (tabela CGJ-RJ n° 8). Preservado como string. Ex.: '40'=Compra e Venda, '71'=Doacao, '175'=Compra e Venda com Mutuo, '999'=Outros." },
        "descricaoSubtipo": { "type": "string", "minLength": 2, "maxLength": 250 },
        "dataAssinaturaFinal": { "type": "string", "format": "date" },
        "indAlvaraJudicial": { "type": "boolean" },
        "indPorProcuracao": { "type": "boolean" },
        "indValorDeclarado": { "type": "boolean" },
        "valorDeclarado": { "type": "string", "pattern": "^\\d+\\.\\d{2}$" },
        "moeda": { "$ref": "#/$defs/Moeda" },
        "dadosProcuracao": { "$ref": "#/$defs/DadosProcuracaoEscritura" },
        "objetos": { "$ref": "#/$defs/ObjetosEscritura" },
        "participantes": { "$ref": "#/$defs/Participantes" },
        "atosVinculados": { "type": "array", "items": { "$ref": "#/$defs/AtoVinculado" } },
        "emolumentos": { "$ref": "#/$defs/Emolumentos" }
      }
    },

    "ProcuracaoDados": {
      "type": "object",
      "title": "ProcuracaoDados",
      "description": "Procuracao publica — lavratura, certidao, substabelecimento ou revogacao.",
      "additionalProperties": false,
      "required": ["categoria", "dataPratica", "selo", "aleatorio", "tipoProcuracao", "tipoLivro", "participantes", "emolumentos"],
      "properties": {
        "categoria": { "const": "ATO_SELADO" },
        "dataPratica": { "type": "string", "format": "date" },
        "selo": { "type": "string", "pattern": "^[A-Z]{4}\\d{5}$" },
        "aleatorio": { "type": "string", "minLength": 3, "maxLength": 10 },
        "livro": { "type": "string", "minLength": 2, "maxLength": 25 },
        "folhaInicial": { "type": "string", "minLength": 2, "maxLength": 25 },
        "folhaFinal": { "type": "string", "minLength": 2, "maxLength": 25 },
        "numeroAto": { "type": "string", "minLength": 2, "maxLength": 25 },
        "localPratica": { "$ref": "#/$defs/TipoLocalPratica" },
        "dataInicioEficacia": { "type": "string", "format": "date" },
        "dataFimEficacia": { "type": "string", "format": "date" },
        "indCertidaoEletronica": { "type": "boolean" },
        "indAtoEletronico": { "type": "boolean" },
        "urlPdfAto": { "type": "string", "format": "uri", "maxLength": 2083 },
        "hashPdfAto": { "type": "string", "pattern": "^[A-Fa-f0-9]{64}$" },
        "urlDossie": { "type": "string", "format": "uri", "maxLength": 2083 },
        "hashDossie": { "type": "string", "pattern": "^[A-Fa-f0-9]{64}$" },
        "matriculaNotarialEletronica": { "type": "string", "minLength": 24, "maxLength": 29 },
        "tipoProcuracao": { "$ref": "#/$defs/TipoProcuracao" },
        "finalidadeProcuracao": { "$ref": "#/$defs/FinalidadeProcuracao" },
        "tipoLivro": { "$ref": "#/$defs/TipoLivroProcuracao" },
        "dataVigencia": { "type": "string", "format": "date" },
        "procuracaoOriginal": { "$ref": "#/$defs/ProcuracaoOriginal" },
        "participantes": { "$ref": "#/$defs/Participantes" },
        "atosVinculados": { "type": "array", "items": { "$ref": "#/$defs/AtoVinculado" } },
        "emolumentos": { "$ref": "#/$defs/Emolumentos" }
      }
    },

    "TestamentoDados": {
      "type": "object",
      "title": "TestamentoDados",
      "description": "Testamento publico, cerrado ou particular — registro, certidao ou revogacao.",
      "additionalProperties": false,
      "required": ["categoria", "dataPratica", "selo", "aleatorio", "tipoTestamento", "testador", "emolumentos"],
      "properties": {
        "categoria": { "const": "ATO_SELADO" },
        "dataPratica": { "type": "string", "format": "date" },
        "selo": { "type": "string", "pattern": "^[A-Z]{4}\\d{5}$" },
        "aleatorio": { "type": "string", "minLength": 3, "maxLength": 10 },
        "livro": { "type": "string", "minLength": 2, "maxLength": 25 },
        "folhaInicial": { "type": "string", "minLength": 2, "maxLength": 25 },
        "folhaFinal": { "type": "string", "minLength": 2, "maxLength": 25 },
        "numeroAto": { "type": "string", "minLength": 2, "maxLength": 25 },
        "localPratica": { "$ref": "#/$defs/TipoLocalPratica" },
        "dataInicioEficacia": { "type": "string", "format": "date" },
        "dataFimEficacia": { "type": "string", "format": "date" },
        "indCertidaoEletronica": { "type": "boolean" },
        "indAtoEletronico": { "type": "boolean" },
        "urlPdfAto": { "type": "string", "format": "uri", "maxLength": 2083 },
        "hashPdfAto": { "type": "string", "pattern": "^[A-Fa-f0-9]{64}$" },
        "urlDossie": { "type": "string", "format": "uri", "maxLength": 2083 },
        "hashDossie": { "type": "string", "pattern": "^[A-Fa-f0-9]{64}$" },
        "matriculaNotarialEletronica": { "type": "string", "minLength": 24, "maxLength": 29 },
        "tipoTestamento": { "$ref": "#/$defs/TipoTestamento" },
        "testamentoOriginal": { "$ref": "#/$defs/TestamentoOriginal" },
        "testador": { "$ref": "#/$defs/Pessoa" },
        "atosVinculados": { "type": "array", "items": { "$ref": "#/$defs/AtoVinculado" } },
        "emolumentos": { "$ref": "#/$defs/Emolumentos" }
      }
    },

    "FirmaDados": {
      "type": "object",
      "title": "FirmaDados",
      "description": "Atos de firma — abertura ou reconhecimento (semelhanca, autenticidade, chancela, sinal publico).",
      "additionalProperties": false,
      "required": ["categoria", "dataPratica", "selo", "aleatorio", "tipoFirma", "pessoasFirma", "emolumentos"],
      "properties": {
        "categoria": { "const": "ATO_SELADO" },
        "dataPratica": { "type": "string", "format": "date" },
        "selo": { "type": "string", "pattern": "^[A-Z]{4}\\d{5}$" },
        "aleatorio": { "type": "string", "minLength": 3, "maxLength": 10 },
        "livro": { "type": "string", "minLength": 2, "maxLength": 25 },
        "folhaInicial": { "type": "string", "minLength": 2, "maxLength": 25 },
        "folhaFinal": { "type": "string", "minLength": 2, "maxLength": 25 },
        "numeroAto": { "type": "string", "minLength": 2, "maxLength": 25 },
        "localPratica": { "$ref": "#/$defs/TipoLocalPratica" },
        "dataInicioEficacia": { "type": "string", "format": "date" },
        "dataFimEficacia": { "type": "string", "format": "date" },
        "indCertidaoEletronica": { "type": "boolean" },
        "indAtoEletronico": { "type": "boolean" },
        "urlPdfAto": { "type": "string", "format": "uri", "maxLength": 2083 },
        "hashPdfAto": { "type": "string", "pattern": "^[A-Fa-f0-9]{64}$" },
        "urlDossie": { "type": "string", "format": "uri", "maxLength": 2083 },
        "hashDossie": { "type": "string", "pattern": "^[A-Fa-f0-9]{64}$" },
        "matriculaNotarialEletronica": { "type": "string", "minLength": 24, "maxLength": 29 },
        "tipoFirma": { "$ref": "#/$defs/TipoFirma" },
        "codigoEtiqueta": { "type": "string", "minLength": 2, "maxLength": 25 },
        "tipoDocumento": { "$ref": "#/$defs/TipoDocumentoFirma" },
        "descricaoDocumento": { "type": "string", "minLength": 2, "maxLength": 500 },
        "pessoasFirma": { "type": "array", "minItems": 1, "items": { "$ref": "#/$defs/Pessoa" } },
        "atosVinculados": { "type": "array", "items": { "$ref": "#/$defs/AtoVinculado" } },
        "emolumentos": { "$ref": "#/$defs/Emolumentos" }
      }
    },

    "AtoNotarialEletronicoDados": {
      "type": "object",
      "title": "AtoNotarialEletronicoDados",
      "description": "Ato Notarial Eletronico (e-Notariado, Provimento CNJ 100/2020).",
      "additionalProperties": false,
      "required": ["categoria", "dataPratica", "selo", "aleatorio", "tipoAtoNotarialEletronico", "emolumentos"],
      "properties": {
        "categoria": { "const": "ATO_SELADO" },
        "dataPratica": { "type": "string", "format": "date" },
        "selo": { "type": "string", "pattern": "^[A-Z]{4}\\d{5}$" },
        "aleatorio": { "type": "string", "minLength": 3, "maxLength": 10 },
        "livro": { "type": "string", "minLength": 2, "maxLength": 25 },
        "folhaInicial": { "type": "string", "minLength": 2, "maxLength": 25 },
        "folhaFinal": { "type": "string", "minLength": 2, "maxLength": 25 },
        "numeroAto": { "type": "string", "minLength": 2, "maxLength": 25 },
        "localPratica": { "$ref": "#/$defs/TipoLocalPratica" },
        "dataInicioEficacia": { "type": "string", "format": "date" },
        "dataFimEficacia": { "type": "string", "format": "date" },
        "indCertidaoEletronica": { "type": "boolean" },
        "indAtoEletronico": { "type": "boolean" },
        "urlPdfAto": { "type": "string", "format": "uri", "maxLength": 2083 },
        "hashPdfAto": { "type": "string", "pattern": "^[A-Fa-f0-9]{64}$" },
        "urlDossie": { "type": "string", "format": "uri", "maxLength": 2083 },
        "hashDossie": { "type": "string", "pattern": "^[A-Fa-f0-9]{64}$" },
        "matriculaNotarialEletronica": { "type": "string", "minLength": 24, "maxLength": 29 },
        "tipoAtoNotarialEletronico": { "$ref": "#/$defs/TipoAtoNotarialEletronico" },
        "emolumentos": { "$ref": "#/$defs/Emolumentos" }
      }
    },

    "AutenticacaoCpfDados": {
      "type": "object",
      "title": "AutenticacaoCpfDados",
      "description": "Autenticacao de copia com apresentante portador de CPF.",
      "additionalProperties": false,
      "required": ["categoria", "dataPratica", "selo", "aleatorio", "codigoEtiqueta", "dataAutenticacao", "cpfApresentante", "emolumentos"],
      "properties": {
        "categoria": { "const": "ATO_SELADO" },
        "dataPratica": { "type": "string", "format": "date" },
        "selo": { "type": "string", "pattern": "^[A-Z]{4}\\d{5}$" },
        "aleatorio": { "type": "string", "minLength": 3, "maxLength": 10 },
        "livro": { "type": "string", "minLength": 2, "maxLength": 25 },
        "folhaInicial": { "type": "string", "minLength": 2, "maxLength": 25 },
        "folhaFinal": { "type": "string", "minLength": 2, "maxLength": 25 },
        "numeroAto": { "type": "string", "minLength": 2, "maxLength": 25 },
        "localPratica": { "$ref": "#/$defs/TipoLocalPratica" },
        "dataInicioEficacia": { "type": "string", "format": "date" },
        "dataFimEficacia": { "type": "string", "format": "date" },
        "indCertidaoEletronica": { "type": "boolean" },
        "indAtoEletronico": { "type": "boolean" },
        "urlPdfAto": { "type": "string", "format": "uri", "maxLength": 2083 },
        "hashPdfAto": { "type": "string", "pattern": "^[A-Fa-f0-9]{64}$" },
        "urlDossie": { "type": "string", "format": "uri", "maxLength": 2083 },
        "hashDossie": { "type": "string", "pattern": "^[A-Fa-f0-9]{64}$" },
        "matriculaNotarialEletronica": { "type": "string", "minLength": 24, "maxLength": 29 },
        "codigoEtiqueta": { "type": "string", "minLength": 2, "maxLength": 25 },
        "dataAutenticacao": { "type": "string", "format": "date-time" },
        "cpfApresentante": { "type": "string", "pattern": "^\\d{11}$" },
        "emolumentos": { "$ref": "#/$defs/Emolumentos" }
      }
    },

    "AutenticacaoRgDados": {
      "type": "object",
      "title": "AutenticacaoRgDados",
      "description": "Autenticacao com apresentante portador de RG (sem CPF).",
      "additionalProperties": false,
      "required": ["categoria", "dataPratica", "selo", "aleatorio", "codigoEtiqueta", "dataAutenticacao", "nomeApresentante", "enderecoApresentante", "identidadeApresentante", "orgaoEmissorIdentidade", "dataEmissaoIdentidade", "emolumentos"],
      "properties": {
        "categoria": { "const": "ATO_SELADO" },
        "dataPratica": { "type": "string", "format": "date" },
        "selo": { "type": "string", "pattern": "^[A-Z]{4}\\d{5}$" },
        "aleatorio": { "type": "string", "minLength": 3, "maxLength": 10 },
        "livro": { "type": "string", "minLength": 2, "maxLength": 25 },
        "folhaInicial": { "type": "string", "minLength": 2, "maxLength": 25 },
        "folhaFinal": { "type": "string", "minLength": 2, "maxLength": 25 },
        "numeroAto": { "type": "string", "minLength": 2, "maxLength": 25 },
        "localPratica": { "$ref": "#/$defs/TipoLocalPratica" },
        "dataInicioEficacia": { "type": "string", "format": "date" },
        "dataFimEficacia": { "type": "string", "format": "date" },
        "indCertidaoEletronica": { "type": "boolean" },
        "indAtoEletronico": { "type": "boolean" },
        "urlPdfAto": { "type": "string", "format": "uri", "maxLength": 2083 },
        "hashPdfAto": { "type": "string", "pattern": "^[A-Fa-f0-9]{64}$" },
        "urlDossie": { "type": "string", "format": "uri", "maxLength": 2083 },
        "hashDossie": { "type": "string", "pattern": "^[A-Fa-f0-9]{64}$" },
        "matriculaNotarialEletronica": { "type": "string", "minLength": 24, "maxLength": 29 },
        "codigoEtiqueta": { "type": "string", "minLength": 2, "maxLength": 25 },
        "dataAutenticacao": { "type": "string", "format": "date-time" },
        "nomeApresentante": { "type": "string", "minLength": 2, "maxLength": 200 },
        "enderecoApresentante": { "type": "string", "minLength": 2, "maxLength": 250 },
        "identidadeApresentante": { "type": "string", "minLength": 2, "maxLength": 25 },
        "orgaoEmissorIdentidade": { "type": "string", "minLength": 2, "maxLength": 70 },
        "dataEmissaoIdentidade": { "type": "string", "format": "date" },
        "emolumentos": { "$ref": "#/$defs/Emolumentos" }
      }
    },

    "AutenticacaoEstrangeiroDados": {
      "type": "object",
      "title": "AutenticacaoEstrangeiroDados",
      "description": "Autenticacao com apresentante estrangeiro portador de passaporte.",
      "additionalProperties": false,
      "required": ["categoria", "dataPratica", "selo", "aleatorio", "codigoEtiqueta", "dataAutenticacao", "nomeApresentante", "enderecoApresentante", "numeroPassaporte", "paisEmissor", "emolumentos"],
      "properties": {
        "categoria": { "const": "ATO_SELADO" },
        "dataPratica": { "type": "string", "format": "date" },
        "selo": { "type": "string", "pattern": "^[A-Z]{4}\\d{5}$" },
        "aleatorio": { "type": "string", "minLength": 3, "maxLength": 10 },
        "livro": { "type": "string", "minLength": 2, "maxLength": 25 },
        "folhaInicial": { "type": "string", "minLength": 2, "maxLength": 25 },
        "folhaFinal": { "type": "string", "minLength": 2, "maxLength": 25 },
        "numeroAto": { "type": "string", "minLength": 2, "maxLength": 25 },
        "localPratica": { "$ref": "#/$defs/TipoLocalPratica" },
        "dataInicioEficacia": { "type": "string", "format": "date" },
        "dataFimEficacia": { "type": "string", "format": "date" },
        "indCertidaoEletronica": { "type": "boolean" },
        "indAtoEletronico": { "type": "boolean" },
        "urlPdfAto": { "type": "string", "format": "uri", "maxLength": 2083 },
        "hashPdfAto": { "type": "string", "pattern": "^[A-Fa-f0-9]{64}$" },
        "urlDossie": { "type": "string", "format": "uri", "maxLength": 2083 },
        "hashDossie": { "type": "string", "pattern": "^[A-Fa-f0-9]{64}$" },
        "matriculaNotarialEletronica": { "type": "string", "minLength": 24, "maxLength": 29 },
        "codigoEtiqueta": { "type": "string", "minLength": 2, "maxLength": 25 },
        "dataAutenticacao": { "type": "string", "format": "date-time" },
        "nomeApresentante": { "type": "string", "minLength": 2, "maxLength": 200 },
        "enderecoApresentante": { "type": "string", "minLength": 2, "maxLength": 250 },
        "numeroPassaporte": { "type": "string", "minLength": 2, "maxLength": 25 },
        "paisEmissor": { "type": "string", "minLength": 2, "maxLength": 50 },
        "emolumentos": { "$ref": "#/$defs/Emolumentos" }
      }
    },

    "CertidaoGenericaDados": {
      "type": "object",
      "title": "CertidaoGenericaDados",
      "description": "Certidao generica (escritura, procuracao, testamento ou firma) — positiva ou negativa.",
      "additionalProperties": false,
      "required": ["categoria", "dataPratica", "selo", "aleatorio", "tipoCertidao", "negativa", "participantes", "emolumentos"],
      "properties": {
        "categoria": { "const": "ATO_SELADO" },
        "dataPratica": { "type": "string", "format": "date" },
        "selo": { "type": "string", "pattern": "^[A-Z]{4}\\d{5}$" },
        "aleatorio": { "type": "string", "minLength": 3, "maxLength": 10 },
        "livro": { "type": "string", "minLength": 2, "maxLength": 25 },
        "folhaInicial": { "type": "string", "minLength": 2, "maxLength": 25 },
        "folhaFinal": { "type": "string", "minLength": 2, "maxLength": 25 },
        "numeroAto": { "type": "string", "minLength": 2, "maxLength": 25 },
        "localPratica": { "$ref": "#/$defs/TipoLocalPratica" },
        "dataInicioEficacia": { "type": "string", "format": "date" },
        "dataFimEficacia": { "type": "string", "format": "date" },
        "indCertidaoEletronica": { "type": "boolean" },
        "indAtoEletronico": { "type": "boolean" },
        "urlPdfAto": { "type": "string", "format": "uri", "maxLength": 2083 },
        "hashPdfAto": { "type": "string", "pattern": "^[A-Fa-f0-9]{64}$" },
        "urlDossie": { "type": "string", "format": "uri", "maxLength": 2083 },
        "hashDossie": { "type": "string", "pattern": "^[A-Fa-f0-9]{64}$" },
        "matriculaNotarialEletronica": { "type": "string", "minLength": 24, "maxLength": 29 },
        "tipoCertidao": { "$ref": "#/$defs/TipoCertidaoGenerica" },
        "negativa": { "type": "boolean" },
        "participantes": { "$ref": "#/$defs/Participantes" },
        "atosVinculados": { "type": "array", "items": { "$ref": "#/$defs/AtoVinculado" } },
        "emolumentos": { "$ref": "#/$defs/Emolumentos" }
      }
    },

    "MaterializacaoDocEletronicoDados": {
      "type": "object",
      "title": "MaterializacaoDocEletronicoDados",
      "description": "Materializacao de documento eletronico (impressao com fe publica de website ou arquivo).",
      "additionalProperties": false,
      "required": ["categoria", "dataPratica", "selo", "aleatorio", "origemDoc", "qtdTotalFolhas", "numeroFolha", "dataImpressao", "emolumentos"],
      "properties": {
        "categoria": { "const": "ATO_SELADO" },
        "dataPratica": { "type": "string", "format": "date" },
        "selo": { "type": "string", "pattern": "^[A-Z]{4}\\d{5}$" },
        "aleatorio": { "type": "string", "minLength": 3, "maxLength": 10 },
        "livro": { "type": "string", "minLength": 2, "maxLength": 25 },
        "folhaInicial": { "type": "string", "minLength": 2, "maxLength": 25 },
        "folhaFinal": { "type": "string", "minLength": 2, "maxLength": 25 },
        "numeroAto": { "type": "string", "minLength": 2, "maxLength": 25 },
        "localPratica": { "$ref": "#/$defs/TipoLocalPratica" },
        "dataInicioEficacia": { "type": "string", "format": "date" },
        "dataFimEficacia": { "type": "string", "format": "date" },
        "indCertidaoEletronica": { "type": "boolean" },
        "indAtoEletronico": { "type": "boolean" },
        "urlPdfAto": { "type": "string", "format": "uri", "maxLength": 2083 },
        "hashPdfAto": { "type": "string", "pattern": "^[A-Fa-f0-9]{64}$" },
        "urlDossie": { "type": "string", "format": "uri", "maxLength": 2083 },
        "hashDossie": { "type": "string", "pattern": "^[A-Fa-f0-9]{64}$" },
        "matriculaNotarialEletronica": { "type": "string", "minLength": 24, "maxLength": 29 },
        "origemDoc": { "$ref": "#/$defs/OrigemDocMaterializacao" },
        "qtdTotalFolhas": { "type": "integer", "minimum": 1, "maximum": 999999 },
        "numeroFolha": { "type": "integer", "minimum": 1, "maximum": 999999 },
        "dataImpressao": { "type": "string", "format": "date-time" },
        "url": { "type": "string", "format": "uri", "maxLength": 1000 },
        "nomeArquivo": { "type": "string", "minLength": 2, "maxLength": 100 },
        "formatoArquivo": { "type": "string", "minLength": 2, "maxLength": 4 },
        "dataArquivo": { "type": "string", "format": "date-time" },
        "tamanhoArquivoKb": { "type": "integer", "minimum": 1, "maximum": 9999999999 },
        "emolumentos": { "$ref": "#/$defs/Emolumentos" }
      }
    },

    "ApostilamentoDados": {
      "type": "object",
      "title": "ApostilamentoDados",
      "description": "Apostilamento — Convencao da Haia (Apostille).",
      "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", "minLength": 3, "maxLength": 10 },
        "livro": { "type": "string", "minLength": 2, "maxLength": 25 },
        "folhaInicial": { "type": "string", "minLength": 2, "maxLength": 25 },
        "folhaFinal": { "type": "string", "minLength": 2, "maxLength": 25 },
        "numeroAto": { "type": "string", "minLength": 2, "maxLength": 25 },
        "localPratica": { "$ref": "#/$defs/TipoLocalPratica" },
        "dataInicioEficacia": { "type": "string", "format": "date" },
        "dataFimEficacia": { "type": "string", "format": "date" },
        "indCertidaoEletronica": { "type": "boolean" },
        "indAtoEletronico": { "type": "boolean" },
        "urlPdfAto": { "type": "string", "format": "uri", "maxLength": 2083 },
        "hashPdfAto": { "type": "string", "pattern": "^[A-Fa-f0-9]{64}$" },
        "urlDossie": { "type": "string", "format": "uri", "maxLength": 2083 },
        "hashDossie": { "type": "string", "pattern": "^[A-Fa-f0-9]{64}$" },
        "matriculaNotarialEletronica": { "type": "string", "minLength": 24, "maxLength": 29 },
        "documento": { "type": "string", "minLength": 2, "maxLength": 50 },
        "apostilador": { "type": "string", "minLength": 2, "maxLength": 50 },
        "documentoApostilador": { "type": "string", "minLength": 2, "maxLength": 25 },
        "participantes": { "$ref": "#/$defs/Participantes" },
        "emolumentos": { "$ref": "#/$defs/Emolumentos" }
      }
    },

    "VistoDados": {
      "type": "object",
      "title": "VistoDados",
      "description": "Visto — apostilamento por embaixada/consulado (revalidacao de ato anterior).",
      "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", "minLength": 3, "maxLength": 10 },
        "livro": { "type": "string", "minLength": 2, "maxLength": 25 },
        "folhaInicial": { "type": "string", "minLength": 2, "maxLength": 25 },
        "folhaFinal": { "type": "string", "minLength": 2, "maxLength": 25 },
        "numeroAto": { "type": "string", "minLength": 2, "maxLength": 25 },
        "localPratica": { "$ref": "#/$defs/TipoLocalPratica" },
        "dataInicioEficacia": { "type": "string", "format": "date" },
        "dataFimEficacia": { "type": "string", "format": "date" },
        "indCertidaoEletronica": { "type": "boolean" },
        "indAtoEletronico": { "type": "boolean" },
        "urlPdfAto": { "type": "string", "format": "uri", "maxLength": 2083 },
        "hashPdfAto": { "type": "string", "pattern": "^[A-Fa-f0-9]{64}$" },
        "urlDossie": { "type": "string", "format": "uri", "maxLength": 2083 },
        "hashDossie": { "type": "string", "pattern": "^[A-Fa-f0-9]{64}$" },
        "matriculaNotarialEletronica": { "type": "string", "minLength": 24, "maxLength": 29 },
        "revalidada": { "type": "boolean" },
        "participantes": { "$ref": "#/$defs/Participantes" },
        "atosVinculados": { "type": "array", "items": { "$ref": "#/$defs/AtoVinculado" } },
        "emolumentos": { "$ref": "#/$defs/Emolumentos" }
      }
    },

    "EncerramentoLivroDados": {
      "type": "object",
      "title": "EncerramentoLivroDados",
      "description": "Encerramento de livro notarial. Transmissao nao selada (CCT).",
      "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", "maxLength": 2083 },
        "hashPdfAto": { "type": "string", "pattern": "^[A-Fa-f0-9]{64}$" },
        "urlDossie": { "type": "string", "format": "uri", "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 },
        "identificacaoLivro": { "type": "string", "minLength": 2, "maxLength": 100 },
        "dataEncerramento": { "type": "string", "format": "date" }
      }
    },

    "FolhaAdicionalComplementoDados": {
      "type": "object",
      "title": "FolhaAdicionalComplementoDados",
      "description": "Folha adicional — complemento de certidao quanto a emolumentos e fundos.",
      "additionalProperties": false,
      "required": ["categoria", "dataPratica", "cct", "qtdPaginasExcedentes", "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", "maxLength": 2083 },
        "hashPdfAto": { "type": "string", "pattern": "^[A-Fa-f0-9]{64}$" },
        "urlDossie": { "type": "string", "format": "uri", "maxLength": 2083 },
        "hashDossie": { "type": "string", "pattern": "^[A-Fa-f0-9]{64}$" },
        "qtdPaginasExcedentes": { "type": "integer", "minimum": 1, "maximum": 999999 },
        "atosVinculados": { "type": "array", "minItems": 1, "items": { "$ref": "#/$defs/AtoVinculado" } },
        "emolumentos": { "$ref": "#/$defs/Emolumentos" }
      }
    },

    "InformacaoVerbalDados": {
      "type": "object",
      "title": "InformacaoVerbalDados",
      "description": "Informacao verbal — solicitacao por terceiro de informacao oral.",
      "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", "maxLength": 2083 },
        "hashPdfAto": { "type": "string", "pattern": "^[A-Fa-f0-9]{64}$" },
        "urlDossie": { "type": "string", "format": "uri", "maxLength": 2083 },
        "hashDossie": { "type": "string", "pattern": "^[A-Fa-f0-9]{64}$" },
        "numeroAto": { "type": "string", "minLength": 2, "maxLength": 25 },
        "nome": { "type": "string", "minLength": 2, "maxLength": 200 },
        "emolumentos": { "$ref": "#/$defs/Emolumentos" }
      }
    },

    "ComplementoEmolumentosDados": {
      "type": "object",
      "title": "ComplementoEmolumentosDados",
      "description": "Complemento de emolumentos de ato anterior. Vinculo obrigatorio ao ato original.",
      "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", "maxLength": 2083 },
        "hashPdfAto": { "type": "string", "pattern": "^[A-Fa-f0-9]{64}$" },
        "urlDossie": { "type": "string", "format": "uri", "maxLength": 2083 },
        "hashDossie": { "type": "string", "pattern": "^[A-Fa-f0-9]{64}$" },
        "atosVinculados": { "type": "array", "minItems": 1, "items": { "$ref": "#/$defs/AtoVinculado" } },
        "emolumentos": { "$ref": "#/$defs/Emolumentos" }
      }
    },

    "DesistenciaAtoDados": {
      "type": "object",
      "title": "DesistenciaAtoDados",
      "description": "Desistencia de ato.",
      "additionalProperties": false,
      "required": ["categoria", "dataPratica", "cct", "tipoAtoOrigem", "motivo", "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", "maxLength": 2083 },
        "hashPdfAto": { "type": "string", "pattern": "^[A-Fa-f0-9]{64}$" },
        "urlDossie": { "type": "string", "format": "uri", "maxLength": 2083 },
        "hashDossie": { "type": "string", "pattern": "^[A-Fa-f0-9]{64}$" },
        "tipoAtoOrigem": { "type": "string", "minLength": 2, "maxLength": 250 },
        "motivo": { "$ref": "#/$defs/MotivoDesistencia" },
        "descricaoMotivo": { "type": "string", "minLength": 2, "maxLength": 250 },
        "emolumentos": { "$ref": "#/$defs/Emolumentos" }
      }
    },

    "AlteracaoEmolumentosDados": {
      "type": "object",
      "title": "AlteracaoEmolumentosDados",
      "description": "Alteracao de emolumentos de ato existente. Operacao administrativa.",
      "additionalProperties": false,
      "required": ["categoria", "selo", "emolumentos"],
      "properties": {
        "categoria": { "const": "OPERACAO" },
        "selo": { "type": "string", "pattern": "^[A-Z]{4}\\d{5}$" },
        "emolumentos": { "$ref": "#/$defs/Emolumentos" }
      }
    },

    "AlteracaoUrlDados": {
      "type": "object",
      "title": "AlteracaoUrlDados",
      "description": "Alteracao das URLs de ato eletronico. Hashes nao podem ser alterados.",
      "additionalProperties": false,
      "required": ["categoria", "selo"],
      "properties": {
        "categoria": { "const": "OPERACAO" },
        "selo": { "type": "string", "pattern": "^[A-Z]{4}\\d{5}$" },
        "urlPdfAto": { "type": "string", "format": "uri", "maxLength": 2083 },
        "urlDossie": { "type": "string", "format": "uri", "maxLength": 2083 }
      }
    },

    "Ato": {
      "type": "object",
      "additionalProperties": false,
      "required": ["tipoAto", "dadosAto"],
      "properties": {
        "tipoAto": { "type": "string" },
        "dadosAto": { "type": "object" }
      },
      "oneOf": [
        { "properties": { "tipoAto": { "const": "ESCRITURA_LAVRATURA" }, "dadosAto": { "$ref": "#/$defs/EscrituraDados" } } },
        { "properties": { "tipoAto": { "const": "ESCRITURA_CERTIDAO" }, "dadosAto": { "$ref": "#/$defs/EscrituraDados" } } },
        { "properties": { "tipoAto": { "const": "PROCURACAO_LAVRATURA" }, "dadosAto": { "$ref": "#/$defs/ProcuracaoDados" } } },
        { "properties": { "tipoAto": { "const": "PROCURACAO_CERTIDAO" }, "dadosAto": { "$ref": "#/$defs/ProcuracaoDados" } } },
        { "properties": { "tipoAto": { "const": "PROCURACAO_SUBSTABELECIMENTO" }, "dadosAto": { "$ref": "#/$defs/ProcuracaoDados" } } },
        { "properties": { "tipoAto": { "const": "PROCURACAO_REVOGACAO" }, "dadosAto": { "$ref": "#/$defs/ProcuracaoDados" } } },
        { "properties": { "tipoAto": { "const": "TESTAMENTO_REGISTRO_PUBLICO" }, "dadosAto": { "$ref": "#/$defs/TestamentoDados" } } },
        { "properties": { "tipoAto": { "const": "TESTAMENTO_REGISTRO_CERRADO" }, "dadosAto": { "$ref": "#/$defs/TestamentoDados" } } },
        { "properties": { "tipoAto": { "const": "TESTAMENTO_CERTIDAO_PUBLICO" }, "dadosAto": { "$ref": "#/$defs/TestamentoDados" } } },
        { "properties": { "tipoAto": { "const": "TESTAMENTO_CERTIDAO_CERRADO" }, "dadosAto": { "$ref": "#/$defs/TestamentoDados" } } },
        { "properties": { "tipoAto": { "const": "TESTAMENTO_REVOGATORIO" }, "dadosAto": { "$ref": "#/$defs/TestamentoDados" } } },
        { "properties": { "tipoAto": { "const": "TESTAMENTO_CERTIDAO_REVOGACAO" }, "dadosAto": { "$ref": "#/$defs/TestamentoDados" } } },
        { "properties": { "tipoAto": { "const": "FIRMA_ABERTURA" }, "dadosAto": { "$ref": "#/$defs/FirmaDados" } } },
        { "properties": { "tipoAto": { "const": "FIRMA_RECONHECIMENTO_SEMELHANCA" }, "dadosAto": { "$ref": "#/$defs/FirmaDados" } } },
        { "properties": { "tipoAto": { "const": "FIRMA_RECONHECIMENTO_AUTENTICIDADE" }, "dadosAto": { "$ref": "#/$defs/FirmaDados" } } },
        { "properties": { "tipoAto": { "const": "FIRMA_RECONHECIMENTO_CHANCELA" }, "dadosAto": { "$ref": "#/$defs/FirmaDados" } } },
        { "properties": { "tipoAto": { "const": "FIRMA_RECONHECIMENTO_SINAL_PUBLICO" }, "dadosAto": { "$ref": "#/$defs/FirmaDados" } } },
        { "properties": { "tipoAto": { "const": "ATO_NOTARIAL_ELETRONICO_RAEDD" }, "dadosAto": { "$ref": "#/$defs/AtoNotarialEletronicoDados" } } },
        { "properties": { "tipoAto": { "const": "ATO_NOTARIAL_ELETRONICO_RFAV" }, "dadosAto": { "$ref": "#/$defs/AtoNotarialEletronicoDados" } } },
        { "properties": { "tipoAto": { "const": "ATO_NOTARIAL_ELETRONICO_AEV" }, "dadosAto": { "$ref": "#/$defs/AtoNotarialEletronicoDados" } } },
        { "properties": { "tipoAto": { "const": "ATO_NOTARIAL_ELETRONICO_AD_CENAD" }, "dadosAto": { "$ref": "#/$defs/AtoNotarialEletronicoDados" } } },
        { "properties": { "tipoAto": { "const": "AUTENTICACAO_CPF" }, "dadosAto": { "$ref": "#/$defs/AutenticacaoCpfDados" } } },
        { "properties": { "tipoAto": { "const": "AUTENTICACAO_RG" }, "dadosAto": { "$ref": "#/$defs/AutenticacaoRgDados" } } },
        { "properties": { "tipoAto": { "const": "AUTENTICACAO_ESTRANGEIRO" }, "dadosAto": { "$ref": "#/$defs/AutenticacaoEstrangeiroDados" } } },
        { "properties": { "tipoAto": { "const": "CERTIDAO_GENERICA" }, "dadosAto": { "$ref": "#/$defs/CertidaoGenericaDados" } } },
        { "properties": { "tipoAto": { "const": "MATERIALIZACAO_DOC_ELETRONICO" }, "dadosAto": { "$ref": "#/$defs/MaterializacaoDocEletronicoDados" } } },
        { "properties": { "tipoAto": { "const": "APOSTILAMENTO" }, "dadosAto": { "$ref": "#/$defs/ApostilamentoDados" } } },
        { "properties": { "tipoAto": { "const": "VISTO" }, "dadosAto": { "$ref": "#/$defs/VistoDados" } } },
        { "properties": { "tipoAto": { "const": "ENCERRAMENTO_LIVRO" }, "dadosAto": { "$ref": "#/$defs/EncerramentoLivroDados" } } },
        { "properties": { "tipoAto": { "const": "FOLHA_ADICIONAL_COMPLEMENTO" }, "dadosAto": { "$ref": "#/$defs/FolhaAdicionalComplementoDados" } } },
        { "properties": { "tipoAto": { "const": "INFORMACAO_VERBAL" }, "dadosAto": { "$ref": "#/$defs/InformacaoVerbalDados" } } },
        { "properties": { "tipoAto": { "const": "COMPLEMENTO_EMOLUMENTOS" }, "dadosAto": { "$ref": "#/$defs/ComplementoEmolumentosDados" } } },
        { "properties": { "tipoAto": { "const": "DESISTENCIA_ATO" }, "dadosAto": { "$ref": "#/$defs/DesistenciaAtoDados" } } },
        { "properties": { "tipoAto": { "const": "ALTERACAO_EMOLUMENTOS" }, "dadosAto": { "$ref": "#/$defs/AlteracaoEmolumentosDados" } } },
        { "properties": { "tipoAto": { "const": "ALTERACAO_URL" }, "dadosAto": { "$ref": "#/$defs/AlteracaoUrlDados" } } }
      ]
    }
  }
}
