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

  "$defs": {

    "Remessa": {
      "type": "object",
      "title": "Envelope da remessa RCPN",
      "description": "Envelope canonico de transmissao de atos RCPN. Substitui o elemento CivilPessoasNaturais/Remessa do XML 2.09.",
      "additionalProperties": false,
      "required": [
        "id",
        "versaoLayout",
        "codigoServico",
        "tipoOperacao",
        "ambiente",
        "software",
        "dataGeracao"
      ],
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid",
          "description": "Identificador unico da remessa, em UUID v4. Usado para idempotencia.",
          "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}$"
        },
        "versaoLayout": {
          "type": "string",
          "pattern": "^\\d+\\.\\d+\\.\\d+$",
          "description": "Versao semantica do layout. Para esta especificacao: 3.0.0."
        },
        "codigoServico": {
          "type": "string",
          "pattern": "^\\d{1,5}$",
          "description": "Codigo do servico extrajudicial emissor (CodServico do XML 2.09)."
        },
        "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 2.09. 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_DIA_DO_TRABALHO, 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": [
            "REGISTRO_NASCIMENTO",
            "REGISTRO_TRANSCRICAO_NASCIMENTO",
            "CERTIDAO_NASCIMENTO",
            "AVERBACAO_NASCIMENTO",
            "PROCESSO_PATERNIDADE_PROPRIO_SERVICO",
            "AVERIGUACAO_OFICIOSA_PATERNIDADE",
            "PROCESSO_PATERNIDADE_OUTRO_SERVICO",
            "HABILITACAO_CASAMENTO",
            "JUIZ_PAZ",
            "CERTIDAO_HABILITACAO_CASAMENTO",
            "REGISTRO_CASAMENTO",
            "TRANSCRICAO_CASAMENTO",
            "CERTIDAO_CASAMENTO",
            "AVERBACAO_CASAMENTO",
            "REGISTRO_OBITO",
            "CERTIDAO_OBITO",
            "AVERBACAO_OBITO",
            "REGISTRO_EDITAL_PROCLAMAS",
            "CERTIDAO_EDITAL_PROCLAMAS",
            "PROCESSO_ADMINISTRATIVO",
            "CERTIDAO_CRC",
            "CERTIDAO_CRC_NACIONAL",
            "REGISTRO_LIVRO_E",
            "CERTIDAO_LIVRO_E",
            "AVERBACAO_LIVRO_E",
            "CERTIDAO_GENERICA",
            "VISTO",
            "FOLHA_ADICIONAL_COMPLEMENTO",
            "INFORMACAO_VERBAL",
            "COMPLEMENTO_EMOLUMENTOS",
            "ALTERACAO_EMOLUMENTOS",
            "ALTERACAO_URL_ATO_ELETRONICO",
            "MATERIALIZACAO_ATOS_DECISORIOS_FE",
            "APOSTILAMENTO",
            "ENCERRAMENTO_LIVRO",
            "DECLARATORIO_UNIAO_ESTAVEL",
            "DISSOLUCAO_UNIAO_ESTAVEL"
          ]
        },
        "dadosAto": { "type": "object" }
      },
      "oneOf": [
        { "properties": { "tipoAto": { "const": "REGISTRO_NASCIMENTO" }, "dadosAto": { "$ref": "#/$defs/RegistroNascimento" } } },
        { "properties": { "tipoAto": { "const": "REGISTRO_TRANSCRICAO_NASCIMENTO" }, "dadosAto": { "$ref": "#/$defs/RegistroTranscricaoNascimento" } } },
        { "properties": { "tipoAto": { "const": "CERTIDAO_NASCIMENTO" }, "dadosAto": { "$ref": "#/$defs/CertidaoNascimento" } } },
        { "properties": { "tipoAto": { "const": "AVERBACAO_NASCIMENTO" }, "dadosAto": { "$ref": "#/$defs/AverbacaoNascimento" } } },
        { "properties": { "tipoAto": { "const": "PROCESSO_PATERNIDADE_PROPRIO_SERVICO" }, "dadosAto": { "$ref": "#/$defs/ProcessoPaternidadePS" } } },
        { "properties": { "tipoAto": { "const": "AVERIGUACAO_OFICIOSA_PATERNIDADE" }, "dadosAto": { "$ref": "#/$defs/AveriguacaoOficiosaPaternidade" } } },
        { "properties": { "tipoAto": { "const": "PROCESSO_PATERNIDADE_OUTRO_SERVICO" }, "dadosAto": { "$ref": "#/$defs/ProcessoPaternidadeOS" } } },
        { "properties": { "tipoAto": { "const": "HABILITACAO_CASAMENTO" }, "dadosAto": { "$ref": "#/$defs/HabilitacaoCasamento" } } },
        { "properties": { "tipoAto": { "const": "JUIZ_PAZ" }, "dadosAto": { "$ref": "#/$defs/JuizPaz" } } },
        { "properties": { "tipoAto": { "const": "CERTIDAO_HABILITACAO_CASAMENTO" }, "dadosAto": { "$ref": "#/$defs/CertidaoHabilitacaoCasamento" } } },
        { "properties": { "tipoAto": { "const": "REGISTRO_CASAMENTO" }, "dadosAto": { "$ref": "#/$defs/RegistroCasamento" } } },
        { "properties": { "tipoAto": { "const": "TRANSCRICAO_CASAMENTO" }, "dadosAto": { "$ref": "#/$defs/TranscricaoCasamento" } } },
        { "properties": { "tipoAto": { "const": "CERTIDAO_CASAMENTO" }, "dadosAto": { "$ref": "#/$defs/CertidaoCasamento" } } },
        { "properties": { "tipoAto": { "const": "AVERBACAO_CASAMENTO" }, "dadosAto": { "$ref": "#/$defs/AverbacaoCasamento" } } },
        { "properties": { "tipoAto": { "const": "REGISTRO_OBITO" }, "dadosAto": { "$ref": "#/$defs/RegistroObito" } } },
        { "properties": { "tipoAto": { "const": "CERTIDAO_OBITO" }, "dadosAto": { "$ref": "#/$defs/CertidaoObito" } } },
        { "properties": { "tipoAto": { "const": "AVERBACAO_OBITO" }, "dadosAto": { "$ref": "#/$defs/AverbacaoObito" } } },
        { "properties": { "tipoAto": { "const": "REGISTRO_EDITAL_PROCLAMAS" }, "dadosAto": { "$ref": "#/$defs/RegistroEditalProclamas" } } },
        { "properties": { "tipoAto": { "const": "CERTIDAO_EDITAL_PROCLAMAS" }, "dadosAto": { "$ref": "#/$defs/CertidaoEditalProclamas" } } },
        { "properties": { "tipoAto": { "const": "PROCESSO_ADMINISTRATIVO" }, "dadosAto": { "$ref": "#/$defs/ProcessoAdministrativo" } } },
        { "properties": { "tipoAto": { "const": "CERTIDAO_CRC" }, "dadosAto": { "$ref": "#/$defs/CertidaoCRC" } } },
        { "properties": { "tipoAto": { "const": "CERTIDAO_CRC_NACIONAL" }, "dadosAto": { "$ref": "#/$defs/CertidaoCRCNacional" } } },
        { "properties": { "tipoAto": { "const": "REGISTRO_LIVRO_E" }, "dadosAto": { "$ref": "#/$defs/RegistroLivroE" } } },
        { "properties": { "tipoAto": { "const": "CERTIDAO_LIVRO_E" }, "dadosAto": { "$ref": "#/$defs/CertidaoLivroE" } } },
        { "properties": { "tipoAto": { "const": "AVERBACAO_LIVRO_E" }, "dadosAto": { "$ref": "#/$defs/AverbacaoLivroE" } } },
        { "properties": { "tipoAto": { "const": "CERTIDAO_GENERICA" }, "dadosAto": { "$ref": "#/$defs/CertidaoGenerica" } } },
        { "properties": { "tipoAto": { "const": "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": "ALTERACAO_URL_ATO_ELETRONICO" }, "dadosAto": { "$ref": "#/$defs/AlteracaoUrlAtoEletronico" } } },
        { "properties": { "tipoAto": { "const": "MATERIALIZACAO_ATOS_DECISORIOS_FE" }, "dadosAto": { "$ref": "#/$defs/MaterializacaoAtosDecisoriosFE" } } },
        { "properties": { "tipoAto": { "const": "APOSTILAMENTO" }, "dadosAto": { "$ref": "#/$defs/Apostilamento" } } },
        { "properties": { "tipoAto": { "const": "ENCERRAMENTO_LIVRO" }, "dadosAto": { "$ref": "#/$defs/EncerramentoLivro" } } },
        { "properties": { "tipoAto": { "const": "DECLARATORIO_UNIAO_ESTAVEL" }, "dadosAto": { "$ref": "#/$defs/DeclaratorioUniaoEstavel" } } },
        { "properties": { "tipoAto": { "const": "DISSOLUCAO_UNIAO_ESTAVEL" }, "dadosAto": { "$ref": "#/$defs/DissolucaoUniaoEstavel" } } }
      ]
    },

    "AtoBase": {
      "type": "object",
      "title": "Campos comuns de ato selado",
      "description": "Campos compartilhados por atos selados (categoria=ATO_SELADO). Substitui o complexType Ato do XSD 2.09.",
      "properties": {
        "categoria": {
          "type": "string",
          "const": "ATO_SELADO",
          "description": "Categoria do ato. ATO_SELADO usa selo SFE; alternativa: TRANSMISSAO_NAO_SELADA (CCT) ou OPERACAO."
        },
        "dataPratica": {
          "type": "string",
          "format": "date",
          "description": "Data da pratica do ato (ISO 8601). Substitui DataPratica (dd/mm/aaaa)."
        },
        "selo": {
          "type": "string",
          "pattern": "^[A-Z]{4}\\d{5}$",
          "description": "Selo SFE no formato 4 letras + 5 digitos (ex.: EABC12345)."
        },
        "aleatorio": {
          "type": "string",
          "pattern": "^[A-Z]{3}$",
          "description": "Aleatorio do selo SFE (3 letras maiusculas)."
        },
        "atoOriginal": { "$ref": "#/$defs/ReferenciaAto" },
        "atoReferencia": { "$ref": "#/$defs/ReferenciaAto" },
        "livro": {
          "type": "string",
          "minLength": 1,
          "maxLength": 25,
          "description": "Identificacao do livro (ex.: A-21)."
        },
        "folha": {
          "type": "string",
          "minLength": 1,
          "maxLength": 25,
          "description": "Identificacao da folha."
        },
        "termo": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9999999999,
          "description": "Numero do termo. No XML 2.09 era string \\d{1,10}; aqui integer."
        },
        "matriculaNacional": {
          "type": "string",
          "pattern": "^\\d{32}$",
          "description": "Matricula nacional (32 digitos), conforme Decreto 6.828/2009 e Provimento 2/2009 CNJ."
        },
        "tipoLivro": {
          "type": "string",
          "pattern": "^[1-9]$",
          "description": "Codigo numerico do tipo de livro (1 a 9), preservado por ser indexador externo CGJ-RJ."
        },
        "ordemJudicial": {
          "type": "boolean",
          "description": "Indica se o ato decorre de ordem judicial. Substitui OrdemJudicial 'S'/'N'."
        },
        "numeroProcessoJudicial": {
          "type": "string",
          "minLength": 1,
          "maxLength": 25,
          "description": "Numero do processo judicial. Obrigatorio quando ordemJudicial=true."
        },
        "dataSentencaDecisao": {
          "type": "string",
          "format": "date",
          "description": "Data da sentenca/decisao judicial (ISO 8601). Obrigatoria quando ordemJudicial=true."
        },
        "observacoes": {
          "type": "string",
          "minLength": 2,
          "maxLength": 4000,
          "description": "Observacoes livres do ato."
        },
        "indCertidaoEletronica": {
          "type": "boolean",
          "description": "Indica certidao eletronica. No XML 2.09 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 2.09.",
      "properties": {
        "categoria": {
          "type": "string",
          "const": "TRANSMISSAO_NAO_SELADA",
          "description": "Categoria do ato. TRANSMISSAO_NAO_SELADA usa CCT em vez de selo."
        },
        "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}$" }
      }
    },

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

    "Endereco": {
      "type": "object",
      "title": "Endereco",
      "description": "Endereco de pessoa ou de obito (tpEndereco do XSD 2.09).",
      "additionalProperties": false,
      "properties": {
        "logradouro": { "type": "string", "minLength": 2, "maxLength": 250, "description": "Logradouro." },
        "numeroLogradouro": { "type": "string", "minLength": 1, "maxLength": 25, "description": "Numero do logradouro (string para aceitar 's/n', '12A', etc.)." },
        "bairro": { "type": "string", "minLength": 2, "maxLength": 250, "description": "Bairro." },
        "complementoLogradouro": { "type": "string", "minLength": 1, "maxLength": 100, "description": "Complemento do logradouro." },
        "codigoIbgeMunicipio": { "type": "integer", "minimum": 1, "maximum": 9999999, "description": "Codigo IBGE do municipio (ate 7 digitos)." }
      }
    },

    "Documento": {
      "type": "object",
      "title": "Documento de identificacao adicional",
      "description": "Item de Pessoa.outrosDocumentos. Substitui tpDocumento do XSD 2.09.",
      "additionalProperties": false,
      "required": ["tipoDocumento", "numeroDocumento"],
      "properties": {
        "tipoDocumento": {
          "type": "string",
          "enum": [
            "NIT",
            "RIC",
            "RNE",
            "TITULO_ELEITOR",
            "PASSAPORTE",
            "CNH",
            "CTPS",
            "CARTEIRA_MARITIMO",
            "DOCUMENTO_ESTRANGEIRO",
            "CERTIDAO_NASCIMENTO",
            "CERTIFICADO_RESERVISTA",
            "NAO_IDENTIFICADO",
            "CERTIDAO_CASAMENTO"
          ],
          "description": "Tipo do documento adicional. Mapeia 1..13 do XSD 2.09 (ver Tabela 17 do layout.md)."
        },
        "numeroDocumento": { "type": "string", "minLength": 1, "maxLength": 100, "description": "Numero do documento." },
        "dataEmissao": { "type": "string", "format": "date", "description": "Data de emissao (ISO 8601)." }
      }
    },

    "Filiacao": {
      "type": "array",
      "title": "Filiacao",
      "description": "Lista de genitores. Substitui tpFiliacao do XSD 2.09 (1..N Genitor).",
      "minItems": 1,
      "items": { "$ref": "#/$defs/Genitor" }
    },

    "Genitor": {
      "type": "object",
      "title": "Genitor (extensao de Pessoa)",
      "description": "Pessoa com tipoFiliacao + progenitores opcionais.",
      "additionalProperties": false,
      "required": ["nome"],
      "properties": {
        "tipoFiliacao": {
          "type": "string",
          "enum": ["MAE", "PAI", "GENITOR"],
          "description": "Vinculo do genitor (M=MAE, P=PAI, G=GENITOR)."
        },
        "nome": { "type": "string", "minLength": 2, "maxLength": 250 },
        "nomeAdotado": { "type": "string", "minLength": 2, "maxLength": 250 },
        "sexo": { "type": "string", "enum": ["FEMININO", "MASCULINO", "NAO_BINARIE", "IGNORADO"] },
        "estadoCivil": {
          "type": "string",
          "enum": [
            "SOLTEIRO",
            "CASADO",
            "VIUVO",
            "SEPARADO_JUDICIALMENTE",
            "DIVORCIADO",
            "SEPARADO_CONSENSUALMENTE",
            "DESQUITADO",
            "IGNORADO"
          ]
        },
        "dataNascimento": { "type": "string", "format": "date" },
        "dataFalecimento": { "type": "string", "format": "date" },
        "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": "Justificativa de ausencia de CPF (1..3 do XSD)."
        },
        "numeroIdentidade": { "type": "string", "minLength": 1, "maxLength": 25 },
        "orgaoEmissor": { "type": "string", "minLength": 2, "maxLength": 70 },
        "codigoOcupacaoSdc": { "type": "string", "pattern": "^-?\\d{1,6}$", "description": "Codigo SDC/MTECBO. Aceita -1, -2 conforme padrao CGJ-RJ." },
        "idade": { "type": "integer", "minimum": 0, "maximum": 150 },
        "nacionalidade": { "type": "integer", "minimum": 1, "maximum": 999, "description": "Codigo ONU/M49 da nacionalidade (1..3 digitos)." },
        "paisNascimento": { "type": "integer", "minimum": 1, "maximum": 999, "description": "Codigo ONU/M49 do pais de nascimento." },
        "codigoIbgeMunicipioNaturalidade": { "type": "integer", "minimum": 1, "maximum": 9999999, "description": "Codigo IBGE do municipio de naturalidade." },
        "outrosDocumentos": { "type": "array", "items": { "$ref": "#/$defs/Documento" } },
        "endereco": { "$ref": "#/$defs/Endereco" },
        "progenitores": {
          "type": "array",
          "minItems": 1,
          "description": "Progenitores do genitor (avos do registrado).",
          "items": { "$ref": "#/$defs/Pessoa" }
        }
      }
    },

    "Pessoa": {
      "type": "object",
      "title": "Pessoa",
      "description": "Estrutura abstrata de pessoa (nascido, conjuge, falecido, declarante, participante, testemunha, convivente, patrono, consultado). Substitui tpPessoa do XSD 2.09.",
      "additionalProperties": false,
      "required": ["nome"],
      "properties": {
        "tipo": { "type": "integer", "minimum": 0, "maximum": 999, "description": "Codigo do tipo de pessoa (campo Tipo do tpPessoa)." },
        "nome": { "type": "string", "minLength": 2, "maxLength": 250 },
        "nomeAdotado": { "type": "string", "minLength": 2, "maxLength": 250 },
        "sexo": { "type": "string", "enum": ["FEMININO", "MASCULINO", "NAO_BINARIE", "IGNORADO"], "description": "F=FEMININO, M=MASCULINO, X=NAO_BINARIE, I=IGNORADO." },
        "estadoCivil": {
          "type": "string",
          "enum": [
            "SOLTEIRO",
            "CASADO",
            "VIUVO",
            "SEPARADO_JUDICIALMENTE",
            "DIVORCIADO",
            "SEPARADO_CONSENSUALMENTE",
            "DESQUITADO",
            "IGNORADO"
          ]
        },
        "dataNascimento": { "type": "string", "format": "date" },
        "dataFalecimento": { "type": "string", "format": "date" },
        "cpf": { "type": "string", "pattern": "^\\d{11}$" },
        "justificativaAusenciaCpf": { "type": "string", "enum": ["NAO_POSSUI", "NAO_DECLARADO", "ESTRANGEIRO"] },
        "numeroIdentidade": { "type": "string", "minLength": 1, "maxLength": 25 },
        "orgaoEmissor": { "type": "string", "minLength": 2, "maxLength": 70 },
        "codigoOcupacaoSdc": { "type": "string", "pattern": "^-?\\d{1,6}$" },
        "idade": { "type": "integer", "minimum": 0, "maximum": 150 },
        "nacionalidade": { "type": "integer", "minimum": 1, "maximum": 999 },
        "paisNascimento": { "type": "integer", "minimum": 1, "maximum": 999 },
        "codigoIbgeMunicipioNaturalidade": { "type": "integer", "minimum": 1, "maximum": 9999999 },
        "outrosDocumentos": { "type": "array", "items": { "$ref": "#/$defs/Documento" } },
        "endereco": { "$ref": "#/$defs/Endereco" },
        "filiacao": { "$ref": "#/$defs/Filiacao" },
        "patronos": { "type": "array", "items": { "$ref": "#/$defs/Pessoa" } }
      }
    },

    "Declarante": {
      "type": "object",
      "title": "Declarante de obito",
      "description": "Pessoa com tipoDeclarante (1..3 do XSD).",
      "additionalProperties": false,
      "required": ["nome", "tipoDeclarante"],
      "properties": {
        "tipoDeclarante": {
          "type": "string",
          "enum": ["AGENTE_PUBLICO", "FAMILIARES_E_AFINS", "AGENTE_FUNERARIO"],
          "description": "Tipo do declarante (1..3 do XSD)."
        },
        "nome": { "type": "string", "minLength": 2, "maxLength": 250 },
        "sexo": { "type": "string", "enum": ["FEMININO", "MASCULINO", "NAO_BINARIE", "IGNORADO"] },
        "estadoCivil": {
          "type": "string",
          "enum": [
            "SOLTEIRO",
            "CASADO",
            "VIUVO",
            "SEPARADO_JUDICIALMENTE",
            "DIVORCIADO",
            "SEPARADO_CONSENSUALMENTE",
            "DESQUITADO",
            "IGNORADO"
          ]
        },
        "dataNascimento": { "type": "string", "format": "date" },
        "cpf": { "type": "string", "pattern": "^\\d{11}$" },
        "justificativaAusenciaCpf": { "type": "string", "enum": ["NAO_POSSUI", "NAO_DECLARADO", "ESTRANGEIRO"] },
        "numeroIdentidade": { "type": "string", "minLength": 1, "maxLength": 25 },
        "orgaoEmissor": { "type": "string", "minLength": 2, "maxLength": 70 },
        "codigoOcupacaoSdc": { "type": "string", "pattern": "^-?\\d{1,6}$" },
        "idade": { "type": "integer", "minimum": 0, "maximum": 150 },
        "nacionalidade": { "type": "integer", "minimum": 1, "maximum": 999 },
        "paisNascimento": { "type": "integer", "minimum": 1, "maximum": 999 },
        "codigoIbgeMunicipioNaturalidade": { "type": "integer", "minimum": 1, "maximum": 9999999 },
        "outrosDocumentos": { "type": "array", "items": { "$ref": "#/$defs/Documento" } },
        "endereco": { "$ref": "#/$defs/Endereco" }
      }
    },

    "ImpressoSeguranca": {
      "type": "object",
      "title": "Impresso de seguranca",
      "description": "Item da lista de impressos de seguranca (papel da Casa da Moeda). Substitui tpImpressoSeguranca.",
      "additionalProperties": false,
      "properties": {
        "dataUtilizacao": {
          "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 utilizacao do impresso (ISO 8601 com offset)."
        },
        "numeroSerie": { "type": "string", "minLength": 1, "maxLength": 25, "description": "Numero de serie do impresso de seguranca." },
        "indSegundaVia": { "type": "boolean", "description": "Indica segunda via (S=true, N=false)." }
      }
    },

    "BeneficioPrevidenciario": {
      "type": "object",
      "title": "Beneficio previdenciario",
      "description": "Item da lista de beneficios previdenciarios do falecido.",
      "additionalProperties": false,
      "required": ["numeroBeneficio"],
      "properties": {
        "numeroBeneficio": { "type": "string", "minLength": 1, "maxLength": 25, "description": "Numero do beneficio previdenciario." }
      }
    },

    "DescricaoTranscricao": {
      "type": "object",
      "title": "Descricao da transcricao",
      "description": "Origem da transcricao (consular, RTD, processo). Substitui tpDescricaoTranscricao.",
      "additionalProperties": false,
      "required": ["tipoDescricao"],
      "properties": {
        "tipoDescricao": {
          "type": "string",
          "enum": ["DADOS_CONSULARES", "REGISTRO_TITULOS_DOCUMENTOS", "PROCESSO_JUDICIAL"],
          "description": "Origem da transcricao (1..3 do XSD)."
        },
        "livro": { "type": "string", "minLength": 1, "maxLength": 10 },
        "folha": { "type": "string", "minLength": 1, "maxLength": 10 },
        "termo": { "type": "string", "minLength": 1, "maxLength": 25 },
        "dataRegistro": { "type": "string", "format": "date" },
        "orgaoConsular": { "type": "string", "minLength": 2, "maxLength": 250 },
        "codigoPais": { "type": "integer", "minimum": 1, "maximum": 999, "description": "Codigo ONU/M49 do pais (ate 3 digitos)." },
        "cidade": { "type": "string", "minLength": 2, "maxLength": 250 },
        "processo": { "type": "string", "minLength": 1, "maxLength": 25 }
      }
    },

    "AtoVinculado": {
      "type": "object",
      "title": "Ato vinculado",
      "description": "Vincula este ato a outro ato (averbacoes, certidoes, complementos). Substitui tpAtosVinculados/AtoVinculado.",
      "additionalProperties": false,
      "required": ["tipoVinculo"],
      "properties": {
        "tipoVinculo": {
          "type": "string",
          "enum": [
            "ATO_HABILITACAO_CASAMENTO",
            "ATO_COMPLEMENTO_EMOLUMENTOS",
            "ATO_ESCRITURA_ANTENUPCIAL",
            "ATO_REGISTRO",
            "ATO_ORIGINAL",
            "ATO_REFERENCIA",
            "ATO_COM_ERRO_MATERIAL",
            "ATO_DE_ACERVO",
            "ATO_ARQUIVADO",
            "PROCESSO_ADMINISTRATIVO"
          ],
          "description": "Tipo do vinculo (I/M/L/G/O/R/E/A/Q/W humanizados)."
        },
        "codigoServico": { "type": "string", "pattern": "^\\d{1,5}$" },
        "codigoServicoCns": { "type": "integer", "minimum": 1, "maximum": 999999, "description": "CNS do servico (1..6 digitos)." },
        "selo": { "type": "string", "pattern": "^[A-Z]{3,4}\\d{5}$" },
        "aleatorio": { "type": "string", "pattern": "^[A-Z]{3}$" },
        "tipoSelo": { "type": "string", "enum": ["FISICO", "ELETRONICO"], "description": "F=FISICO, E=ELETRONICO." },
        "cct": { "type": "string", "pattern": "^[A-Z]{4}\\d{5}$" },
        "seloOutroEstado": { "type": "string", "minLength": 1, "maxLength": 50, "description": "Identificador de selo de outro estado." },
        "dataPratica": { "type": "string", "format": "date" },
        "nomeServico": { "type": "string", "minLength": 2, "maxLength": 250 },
        "estadoServico": { "type": "string", "minLength": 2, "maxLength": 2, "description": "UF do servico (sigla de 2 letras)." },
        "numeroProtocolo": { "type": "string", "minLength": 1, "maxLength": 25 },
        "processo": { "type": "string", "minLength": 1, "maxLength": 50 },
        "tombo": { "type": "string", "minLength": 1, "maxLength": 50 }
      }
    },

    "ItemEmolumento": {
      "type": "object",
      "title": "Item de emolumento",
      "description": "Linha de detalhamento da composicao do emolumento. Substitui ItemEmolumento do XSD.",
      "additionalProperties": false,
      "required": ["tabela", "item", "quantidade"],
      "properties": {
        "ano": { "type": "integer", "minimum": 1900, "maximum": 9999, "description": "Ano de referencia (gYear)." },
        "tabela": { "type": "string", "minLength": 1, "maxLength": 8, "description": "Codigo da tabela de emolumentos CGJ-RJ (preservado como string)." },
        "item": { "type": "string", "minLength": 1, "maxLength": 20, "description": "Item da tabela (preservado)." },
        "subItem": { "type": "string", "maxLength": 20, "description": "Sub-item da tabela (preservado)." },
        "quantidade": { "type": "integer", "minimum": 1, "maximum": 9999, "description": "Quantidade aplicada do 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}, todos os valores e itens sao suprimidos. Substitui tpEmolumentos.",
      "additionalProperties": false,
      "required": ["tipoCobranca"],
      "properties": {
        "tipoCobranca": {
          "type": "string",
          "enum": ["JUSTICA_GRATUITA", "COM_COBRANCA", "SEM_COBRANCA", "NIHIL", "PAGO_NA_PROTOCOLIZACAO"],
          "description": "Modalidade de cobranca: JG=JUSTICA_GRATUITA, CC=COM_COBRANCA, SC=SEM_COBRANCA, NH=NIHIL, PZ=PAGO_NA_PROTOCOLIZACAO."
        },
        "hipossuficiente": {
          "type": "boolean",
          "description": "Indica se o titular declarou hipossuficiencia. Obrigatorio 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 - Fundo Especial do TJ." },
        "fundperj": { "type": "string", "pattern": "^\\d+\\.\\d{2}$", "description": "FUNDPERJ." },
        "funperj": { "type": "string", "pattern": "^\\d+\\.\\d{2}$", "description": "FUNPERJ." },
        "funarpen": { "type": "string", "pattern": "^\\d+\\.\\d{2}$", "description": "FUNARPEN." },
        "valorDistribuidor": { "type": "string", "pattern": "^\\d+\\.\\d{2}$", "description": "Valor para o distribuidor." },
        "valorSeloEletronico": { "type": "string", "pattern": "^\\d+\\.\\d{2}$", "description": "Valor do selo eletronico (RESSAG)." },
        "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" }
        }
      }
    },

    "RegistroNascimento": {
      "type": "object",
      "title": "Registro de Nascimento",
      "description": "Lavra do termo de nascimento no Livro A. Lei 6.015/1973 art. 50.",
      "additionalProperties": false,
      "required": ["categoria", "dataPratica", "selo", "aleatorio", "tipoDocumento", "nascido", "emolumentos"],
      "allOf": [{ "$ref": "#/$defs/AtoBase" }],
      "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}$" },
        "atoOriginal": { "$ref": "#/$defs/ReferenciaAto" },
        "atoReferencia": { "$ref": "#/$defs/ReferenciaAto" },
        "livro": { "type": "string", "minLength": 1, "maxLength": 25 },
        "folha": { "type": "string", "minLength": 1, "maxLength": 25 },
        "termo": { "type": "integer", "minimum": 0, "maximum": 9999999999 },
        "matriculaNacional": { "type": "string", "pattern": "^\\d{32}$" },
        "tipoLivro": { "type": "string", "pattern": "^[1-9]$" },
        "ordemJudicial": { "type": "boolean" },
        "numeroProcessoJudicial": { "type": "string", "minLength": 1, "maxLength": 25 },
        "dataSentencaDecisao": { "type": "string", "format": "date" },
        "observacoes": { "type": "string", "minLength": 2, "maxLength": 4000 },
        "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}$" },
        "tipoDocumento": {
          "type": "string",
          "enum": ["DNV", "ORDEM_JUDICIAL", "OFICIO_PROCESSO_MANDADO", "PROCEDIMENTO_ADM_PROPRIO_SERVICO", "TESTEMUNHAS"],
          "description": "Origem do registro de nascimento (1..5 do XSD)."
        },
        "numeroDocumento": { "type": "string", "minLength": 1, "maxLength": 25 },
        "protocoloConsultaDNV": { "type": "string", "minLength": 1, "maxLength": 25, "description": "Protocolo de consulta na base do SINASC. Obrigatorio se tipoDocumento=DNV." },
        "numeroRgAtribuido": { "type": "string", "minLength": 1, "maxLength": 25 },
        "numeroGemeos": { "type": "integer", "minimum": 0, "maximum": 9, "description": "Numero de gemeos (no XSD era string \\d{1}; aqui integer 0..9)." },
        "local": {
          "type": "string",
          "enum": ["UNIDADE_DE_SAUDE", "FORA_DA_UNIDADE_DE_SAUDE"],
          "description": "Local do nascimento (1=UNIDADE_DE_SAUDE, 2=FORA_DA_UNIDADE_DE_SAUDE)."
        },
        "horaNascimento": { "type": "string", "pattern": "^([01]\\d|2[0-3]):[0-5]\\d$", "description": "Hora do nascimento HH:MM." },
        "nascido": { "$ref": "#/$defs/Pessoa" },
        "testemunhas": { "type": "array", "minItems": 1, "items": { "$ref": "#/$defs/Pessoa" } },
        "impressosSeguranca": { "type": "array", "minItems": 1, "items": { "$ref": "#/$defs/ImpressoSeguranca" } },
        "emolumentos": { "$ref": "#/$defs/Emolumentos" }
      }
    },

    "RegistroTranscricaoNascimento": {
      "type": "object",
      "title": "Registro de Transcricao de Nascimento",
      "description": "Transcricao de nascimento no Livro A com origem consular, RTD ou processo judicial.",
      "additionalProperties": false,
      "required": ["categoria", "dataPratica", "selo", "aleatorio", "descricaoTranscricao", "nascido", "emolumentos"],
      "allOf": [{ "$ref": "#/$defs/AtoBase" }],
      "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}$" },
        "atoOriginal": { "$ref": "#/$defs/ReferenciaAto" },
        "atoReferencia": { "$ref": "#/$defs/ReferenciaAto" },
        "livro": { "type": "string", "minLength": 1, "maxLength": 25 },
        "folha": { "type": "string", "minLength": 1, "maxLength": 25 },
        "termo": { "type": "integer", "minimum": 0, "maximum": 9999999999 },
        "matriculaNacional": { "type": "string", "pattern": "^\\d{32}$" },
        "tipoLivro": { "type": "string", "pattern": "^[1-9]$" },
        "ordemJudicial": { "type": "boolean" },
        "numeroProcessoJudicial": { "type": "string", "minLength": 1, "maxLength": 25 },
        "dataSentencaDecisao": { "type": "string", "format": "date" },
        "observacoes": { "type": "string", "minLength": 2, "maxLength": 4000 },
        "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}$" },
        "descricaoTranscricao": { "$ref": "#/$defs/DescricaoTranscricao" },
        "nascido": { "$ref": "#/$defs/Pessoa" },
        "emolumentos": { "$ref": "#/$defs/Emolumentos" }
      }
    },

    "CertidaoNascimento": {
      "type": "object",
      "title": "Certidao de Nascimento",
      "description": "Certidao de registro de nascimento (RCN, RCTN, RCUI).",
      "additionalProperties": false,
      "required": ["categoria", "dataPratica", "selo", "aleatorio", "tipoCertidao", "interligacao", "inteiroTeor", "nascido", "emolumentos"],
      "allOf": [{ "$ref": "#/$defs/AtoBase" }],
      "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}$" },
        "atoOriginal": { "$ref": "#/$defs/ReferenciaAto" },
        "atoReferencia": { "$ref": "#/$defs/ReferenciaAto" },
        "livro": { "type": "string", "minLength": 1, "maxLength": 25 },
        "folha": { "type": "string", "minLength": 1, "maxLength": 25 },
        "termo": { "type": "integer", "minimum": 0, "maximum": 9999999999 },
        "matriculaNacional": { "type": "string", "pattern": "^\\d{32}$" },
        "tipoLivro": { "type": "string", "pattern": "^[1-9]$" },
        "ordemJudicial": { "type": "boolean" },
        "numeroProcessoJudicial": { "type": "string", "minLength": 1, "maxLength": 25 },
        "dataSentencaDecisao": { "type": "string", "format": "date" },
        "observacoes": { "type": "string", "minLength": 2, "maxLength": 4000 },
        "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": "string",
          "enum": ["CERTIDAO_NASCIMENTO", "CERTIDAO_TRANSCRICAO_NASCIMENTO", "CERTIDAO_INTEIRO_TEOR_NASCIMENTO"],
          "description": "Substitui TipoAto: RCN=CERTIDAO_NASCIMENTO, RCTN=CERTIDAO_TRANSCRICAO_NASCIMENTO, RCUI=CERTIDAO_INTEIRO_TEOR_NASCIMENTO."
        },
        "interligacao": { "type": "boolean", "description": "IndInterligacao: certidao com interligacao CRC." },
        "inteiroTeor": { "type": "boolean", "description": "IndInteiroTeor: certidao em inteiro teor." },
        "nascido": { "$ref": "#/$defs/Pessoa" },
        "emolumentos": { "$ref": "#/$defs/Emolumentos" }
      }
    },

    "AverbacaoNascimento": {
      "type": "object",
      "title": "Averbacao de Nascimento",
      "description": "Averbacao em assento de nascimento. Substitui AtoAverbacaoNascimento.",
      "additionalProperties": false,
      "required": ["categoria", "dataPratica", "selo", "aleatorio", "tipoAverbacaoAto", "tipoAverbacao", "nascido", "emolumentos"],
      "allOf": [{ "$ref": "#/$defs/AtoBase" }],
      "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}$" },
        "atoOriginal": { "$ref": "#/$defs/ReferenciaAto" },
        "atoReferencia": { "$ref": "#/$defs/ReferenciaAto" },
        "livro": { "type": "string", "minLength": 1, "maxLength": 25 },
        "folha": { "type": "string", "minLength": 1, "maxLength": 25 },
        "termo": { "type": "integer", "minimum": 0, "maximum": 9999999999 },
        "matriculaNacional": { "type": "string", "pattern": "^\\d{32}$" },
        "tipoLivro": { "type": "string", "pattern": "^[1-9]$" },
        "ordemJudicial": { "type": "boolean" },
        "numeroProcessoJudicial": { "type": "string", "minLength": 1, "maxLength": 25 },
        "dataSentencaDecisao": { "type": "string", "format": "date" },
        "observacoes": { "type": "string", "minLength": 2, "maxLength": 4000 },
        "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}$" },
        "tipoAverbacaoAto": {
          "type": "string",
          "enum": ["AVERBACAO_NASCIMENTO", "AVERBACAO_TRANSCRICAO_NASCIMENTO"],
          "description": "Substitui TipoAto: RAN=AVERBACAO_NASCIMENTO, RATN=AVERBACAO_TRANSCRICAO_NASCIMENTO."
        },
        "tipoAverbacao": {
          "type": "string",
          "enum": [
            "RECONHECIMENTO_PATERNIDADE_VOLUNTARIA",
            "RECONHECIMENTO_PATERNIDADE_PROC_ADM_PROPRIO",
            "RECONHECIMENTO_PATERNIDADE_PROC_ADM_OUTRO",
            "RECONHECIMENTO_PATERNIDADE_ORDEM_JUDICIAL",
            "ADOCAO",
            "ALTERACAO_NOME",
            "RETIFICACAO",
            "CANCELAMENTO",
            "OUTROS",
            "DESTITUICAO_PODER_FAMILIAR"
          ],
          "description": "N1..N10 humanizados (ver Tabela 4)."
        },
        "numeroProcesso": { "type": "string", "minLength": 1, "maxLength": 25 },
        "nomeServicoReconhecimento": { "type": "string", "minLength": 2, "maxLength": 250 },
        "nascido": { "$ref": "#/$defs/Pessoa" },
        "atosVinculados": { "type": "array", "minItems": 1, "items": { "$ref": "#/$defs/AtoVinculado" } },
        "emolumentos": { "$ref": "#/$defs/Emolumentos" }
      }
    },

    "ProcessoPaternidadePS": {
      "type": "object",
      "title": "Processo de Paternidade no Proprio Servico",
      "description": "Procedimento administrativo de reconhecimento de paternidade (R2) no proprio servico.",
      "additionalProperties": false,
      "required": ["categoria", "dataPratica", "selo", "aleatorio", "tipoProcesso", "nascido", "emolumentos"],
      "allOf": [{ "$ref": "#/$defs/AtoBase" }],
      "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}$" },
        "atoOriginal": { "$ref": "#/$defs/ReferenciaAto" },
        "atoReferencia": { "$ref": "#/$defs/ReferenciaAto" },
        "livro": { "type": "string", "minLength": 1, "maxLength": 25 },
        "folha": { "type": "string", "minLength": 1, "maxLength": 25 },
        "termo": { "type": "integer", "minimum": 0, "maximum": 9999999999 },
        "matriculaNacional": { "type": "string", "pattern": "^\\d{32}$" },
        "tipoLivro": { "type": "string", "pattern": "^[1-9]$" },
        "ordemJudicial": { "type": "boolean" },
        "numeroProcessoJudicial": { "type": "string", "minLength": 1, "maxLength": 25 },
        "dataSentencaDecisao": { "type": "string", "format": "date" },
        "observacoes": { "type": "string", "minLength": 2, "maxLength": 4000 },
        "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}$" },
        "tipoProcesso": {
          "type": "string",
          "enum": ["RECONHECIMENTO_PATERNIDADE_PROPRIO_SERVICO"],
          "description": "R2 humanizado (so admite um valor)."
        },
        "genitor": { "type": "array", "minItems": 0, "maxItems": 2, "items": { "$ref": "#/$defs/Pessoa" } },
        "nascido": { "$ref": "#/$defs/Pessoa" },
        "emolumentos": { "$ref": "#/$defs/Emolumentos" }
      }
    },

    "AveriguacaoOficiosaPaternidade": {
      "type": "object",
      "title": "Averiguacao Oficiosa de Paternidade (AVO)",
      "description": "Transmissao nao selada de averiguacao oficiosa de paternidade.",
      "additionalProperties": false,
      "required": ["categoria", "dataPratica", "cct", "indicacaoPaternidade", "nascido", "emolumentos"],
      "allOf": [{ "$ref": "#/$defs/TransmissaoBase" }],
      "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}$" },
        "indicacaoPaternidade": { "type": "boolean", "description": "Houve indicacao de paternidade pela genitora." },
        "genitor": { "type": "array", "minItems": 0, "maxItems": 2, "items": { "$ref": "#/$defs/Pessoa" } },
        "nascido": { "$ref": "#/$defs/Pessoa" },
        "emolumentos": { "$ref": "#/$defs/Emolumentos" }
      }
    },

    "ProcessoPaternidadeOS": {
      "type": "object",
      "title": "Processo de Paternidade em Outro Servico",
      "description": "Reconhecimento de paternidade tramitado em outro servico (ato selado de averbacao).",
      "additionalProperties": false,
      "required": ["categoria", "dataPratica", "selo", "aleatorio", "genitor", "nascido", "emolumentos"],
      "allOf": [{ "$ref": "#/$defs/AtoBase" }],
      "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}$" },
        "atoOriginal": { "$ref": "#/$defs/ReferenciaAto" },
        "atoReferencia": { "$ref": "#/$defs/ReferenciaAto" },
        "livro": { "type": "string", "minLength": 1, "maxLength": 25 },
        "folha": { "type": "string", "minLength": 1, "maxLength": 25 },
        "termo": { "type": "integer", "minimum": 0, "maximum": 9999999999 },
        "matriculaNacional": { "type": "string", "pattern": "^\\d{32}$" },
        "tipoLivro": { "type": "string", "pattern": "^[1-9]$" },
        "ordemJudicial": { "type": "boolean" },
        "numeroProcessoJudicial": { "type": "string", "minLength": 1, "maxLength": 25 },
        "dataSentencaDecisao": { "type": "string", "format": "date" },
        "observacoes": { "type": "string", "minLength": 2, "maxLength": 4000 },
        "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}$" },
        "codigoServico": { "type": "string", "pattern": "^\\d{1,5}$", "description": "Codigo do outro servico." },
        "nomeServicoOriginal": { "type": "string", "minLength": 2, "maxLength": 250 },
        "estadoServicoOriginal": { "type": "string", "minLength": 2, "maxLength": 2 },
        "genitor": { "type": "array", "minItems": 1, "maxItems": 2, "items": { "$ref": "#/$defs/Pessoa" } },
        "nascido": { "$ref": "#/$defs/Pessoa" },
        "emolumentos": { "$ref": "#/$defs/Emolumentos" }
      }
    },

    "HabilitacaoCasamento": {
      "type": "object",
      "title": "Habilitacao de Casamento",
      "description": "Processo de habilitacao prévia ao casamento. Lei 6.015/1973 art. 67.",
      "additionalProperties": false,
      "required": ["categoria", "dataPratica", "selo", "aleatorio", "processoHabilitacao", "conversaoUniaoEstavel", "separacaoObrigatoriaBens", "conjuges", "emolumentos"],
      "allOf": [{ "$ref": "#/$defs/AtoBase" }],
      "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}$" },
        "atoOriginal": { "$ref": "#/$defs/ReferenciaAto" },
        "atoReferencia": { "$ref": "#/$defs/ReferenciaAto" },
        "livro": { "type": "string", "minLength": 1, "maxLength": 25 },
        "folha": { "type": "string", "minLength": 1, "maxLength": 25 },
        "termo": { "type": "integer", "minimum": 0, "maximum": 9999999999 },
        "matriculaNacional": { "type": "string", "pattern": "^\\d{32}$" },
        "tipoLivro": { "type": "string", "pattern": "^[1-9]$" },
        "ordemJudicial": { "type": "boolean" },
        "numeroProcessoJudicial": { "type": "string", "minLength": 1, "maxLength": 25 },
        "dataSentencaDecisao": { "type": "string", "format": "date" },
        "observacoes": { "type": "string", "minLength": 2, "maxLength": 4000 },
        "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}$" },
        "processoHabilitacao": { "type": "string", "minLength": 1, "maxLength": 25 },
        "conversaoUniaoEstavel": { "type": "boolean", "description": "Conversao de uniao estavel em casamento." },
        "separacaoObrigatoriaBens": { "type": "boolean", "description": "Regime de separacao obrigatoria de bens (CC art. 1.641)." },
        "conjuges": { "type": "array", "minItems": 2, "maxItems": 2, "items": { "$ref": "#/$defs/Pessoa" } },
        "emolumentos": { "$ref": "#/$defs/Emolumentos" }
      }
    },

    "JuizPaz": {
      "type": "object",
      "title": "Designacao de Juiz de Paz",
      "description": "Transmissao nao selada de designacao de juiz de paz para casamento.",
      "additionalProperties": false,
      "required": ["categoria", "dataPratica", "cct", "atosVinculados", "emolumentos"],
      "allOf": [{ "$ref": "#/$defs/TransmissaoBase" }],
      "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" }
      }
    },

    "CertidaoHabilitacaoCasamento": {
      "type": "object",
      "title": "Certidao de Habilitacao de Casamento",
      "description": "Certidao emitida sobre processo de habilitacao de casamento.",
      "additionalProperties": false,
      "required": ["categoria", "dataPratica", "selo", "aleatorio", "processoHabilitacao", "conjuges", "atosVinculados", "emolumentos"],
      "allOf": [{ "$ref": "#/$defs/AtoBase" }],
      "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}$" },
        "atoOriginal": { "$ref": "#/$defs/ReferenciaAto" },
        "atoReferencia": { "$ref": "#/$defs/ReferenciaAto" },
        "livro": { "type": "string", "minLength": 1, "maxLength": 25 },
        "folha": { "type": "string", "minLength": 1, "maxLength": 25 },
        "termo": { "type": "integer", "minimum": 0, "maximum": 9999999999 },
        "matriculaNacional": { "type": "string", "pattern": "^\\d{32}$" },
        "tipoLivro": { "type": "string", "pattern": "^[1-9]$" },
        "ordemJudicial": { "type": "boolean" },
        "numeroProcessoJudicial": { "type": "string", "minLength": 1, "maxLength": 25 },
        "dataSentencaDecisao": { "type": "string", "format": "date" },
        "observacoes": { "type": "string", "minLength": 2, "maxLength": 4000 },
        "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}$" },
        "processoHabilitacao": { "type": "string", "minLength": 1, "maxLength": 25 },
        "conjuges": { "type": "array", "minItems": 2, "maxItems": 2, "items": { "$ref": "#/$defs/Pessoa" } },
        "atosVinculados": { "type": "array", "minItems": 1, "items": { "$ref": "#/$defs/AtoVinculado" } },
        "emolumentos": { "$ref": "#/$defs/Emolumentos" }
      }
    },

    "RegistroCasamento": {
      "type": "object",
      "title": "Registro de Casamento",
      "description": "Lavra do termo de casamento no Livro B. Lei 6.015/1973 art. 70.",
      "additionalProperties": false,
      "required": ["categoria", "dataPratica", "selo", "aleatorio", "dataCasamento", "tipoCelebrante", "tipoUniao", "tipoCasamento", "conversaoUniaoEstavel", "conjuges", "emolumentos"],
      "allOf": [{ "$ref": "#/$defs/AtoBase" }],
      "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}$" },
        "atoOriginal": { "$ref": "#/$defs/ReferenciaAto" },
        "atoReferencia": { "$ref": "#/$defs/ReferenciaAto" },
        "livro": { "type": "string", "minLength": 1, "maxLength": 25 },
        "folha": { "type": "string", "minLength": 1, "maxLength": 25 },
        "termo": { "type": "integer", "minimum": 0, "maximum": 9999999999 },
        "matriculaNacional": { "type": "string", "pattern": "^\\d{32}$" },
        "tipoLivro": { "type": "string", "pattern": "^[1-9]$" },
        "ordemJudicial": { "type": "boolean" },
        "numeroProcessoJudicial": { "type": "string", "minLength": 1, "maxLength": 25 },
        "dataSentencaDecisao": { "type": "string", "format": "date" },
        "observacoes": { "type": "string", "minLength": 2, "maxLength": 4000 },
        "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}$" },
        "dataCasamento": { "type": "string", "format": "date" },
        "dataPublicacaoProclamas": { "type": "string", "format": "date" },
        "tipoCelebrante": {
          "type": "string",
          "enum": ["JUIZ_PAZ", "JUIZ_DIREITO", "AUTORIDADE_RELIGIOSA", "OUTRO"],
          "description": "1=JUIZ_PAZ, 2=JUIZ_DIREITO, 3=AUTORIDADE_RELIGIOSA, 4=OUTRO."
        },
        "tipoUniao": { "type": "string", "enum": ["HETEROAFETIVA", "HOMOAFETIVA"], "description": "1=HETEROAFETIVA, 2=HOMOAFETIVA." },
        "tipoCasamento": {
          "type": "string",
          "enum": [
            "CIVIL",
            "RELIGIOSO_COM_EFEITO_CIVIL",
            "CONVERSAO_UNIAO_ESTAVEL",
            "NUNCUPATIVO",
            "MOLESTIA_GRAVE",
            "EM_DILIGENCIA",
            "POR_PROCURACAO"
          ],
          "description": "Tipos 1..7 do XSD humanizados."
        },
        "regimeCasamento": {
          "type": "string",
          "enum": [
            "COMUNHAO_PARCIAL_BENS",
            "COMUNHAO_UNIVERSAL_BENS",
            "SEPARACAO_TOTAL_BENS",
            "PARTICIPACAO_FINAL_AQUESTOS",
            "SEPARACAO_OBRIGATORIA_BENS"
          ],
          "description": "Tipos 1..5 do XSD humanizados."
        },
        "conversaoUniaoEstavel": { "type": "boolean" },
        "conjuges": { "type": "array", "minItems": 2, "maxItems": 2, "items": { "$ref": "#/$defs/Pessoa" } },
        "impressosSeguranca": { "type": "array", "minItems": 1, "items": { "$ref": "#/$defs/ImpressoSeguranca" } },
        "atosVinculados": { "type": "array", "minItems": 1, "items": { "$ref": "#/$defs/AtoVinculado" } },
        "emolumentos": { "$ref": "#/$defs/Emolumentos" }
      }
    },

    "TranscricaoCasamento": {
      "type": "object",
      "title": "Transcricao de Casamento",
      "description": "Transcricao de casamento ocorrido no exterior, em RTD ou via processo judicial.",
      "additionalProperties": false,
      "required": ["categoria", "dataPratica", "selo", "aleatorio", "dataCasamento", "descricaoTranscricao", "conjuges", "emolumentos"],
      "allOf": [{ "$ref": "#/$defs/AtoBase" }],
      "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}$" },
        "atoOriginal": { "$ref": "#/$defs/ReferenciaAto" },
        "atoReferencia": { "$ref": "#/$defs/ReferenciaAto" },
        "livro": { "type": "string", "minLength": 1, "maxLength": 25 },
        "folha": { "type": "string", "minLength": 1, "maxLength": 25 },
        "termo": { "type": "integer", "minimum": 0, "maximum": 9999999999 },
        "matriculaNacional": { "type": "string", "pattern": "^\\d{32}$" },
        "tipoLivro": { "type": "string", "pattern": "^[1-9]$" },
        "ordemJudicial": { "type": "boolean" },
        "numeroProcessoJudicial": { "type": "string", "minLength": 1, "maxLength": 25 },
        "dataSentencaDecisao": { "type": "string", "format": "date" },
        "observacoes": { "type": "string", "minLength": 2, "maxLength": 4000 },
        "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}$" },
        "dataCasamento": { "type": "string", "format": "date" },
        "descricaoTranscricao": { "$ref": "#/$defs/DescricaoTranscricao" },
        "conjuges": { "type": "array", "minItems": 2, "maxItems": 2, "items": { "$ref": "#/$defs/Pessoa" } },
        "emolumentos": { "$ref": "#/$defs/Emolumentos" }
      }
    },

    "CertidaoCasamento": {
      "type": "object",
      "title": "Certidao de Casamento",
      "description": "Certidao de casamento (RCC ou RCTC).",
      "additionalProperties": false,
      "required": ["categoria", "dataPratica", "selo", "aleatorio", "tipoCertidao", "dataCasamento", "interligacao", "inteiroTeor", "conjuges", "emolumentos"],
      "allOf": [{ "$ref": "#/$defs/AtoBase" }],
      "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}$" },
        "atoOriginal": { "$ref": "#/$defs/ReferenciaAto" },
        "atoReferencia": { "$ref": "#/$defs/ReferenciaAto" },
        "livro": { "type": "string", "minLength": 1, "maxLength": 25 },
        "folha": { "type": "string", "minLength": 1, "maxLength": 25 },
        "termo": { "type": "integer", "minimum": 0, "maximum": 9999999999 },
        "matriculaNacional": { "type": "string", "pattern": "^\\d{32}$" },
        "tipoLivro": { "type": "string", "pattern": "^[1-9]$" },
        "ordemJudicial": { "type": "boolean" },
        "numeroProcessoJudicial": { "type": "string", "minLength": 1, "maxLength": 25 },
        "dataSentencaDecisao": { "type": "string", "format": "date" },
        "observacoes": { "type": "string", "minLength": 2, "maxLength": 4000 },
        "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": "string",
          "enum": ["CERTIDAO_CASAMENTO", "CERTIDAO_TRANSCRICAO_CASAMENTO"],
          "description": "RCC=CERTIDAO_CASAMENTO, RCTC=CERTIDAO_TRANSCRICAO_CASAMENTO."
        },
        "dataCasamento": { "type": "string", "format": "date" },
        "interligacao": { "type": "boolean" },
        "inteiroTeor": { "type": "boolean" },
        "conjuges": { "type": "array", "minItems": 2, "maxItems": 2, "items": { "$ref": "#/$defs/Pessoa" } },
        "emolumentos": { "$ref": "#/$defs/Emolumentos" }
      }
    },

    "AverbacaoCasamento": {
      "type": "object",
      "title": "Averbacao de Casamento",
      "description": "Averbacao em assento de casamento (Livro B).",
      "additionalProperties": false,
      "required": ["categoria", "dataPratica", "selo", "aleatorio", "tipoAverbacaoAto", "tipoAverbacao", "conjuges", "emolumentos"],
      "allOf": [{ "$ref": "#/$defs/AtoBase" }],
      "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}$" },
        "atoOriginal": { "$ref": "#/$defs/ReferenciaAto" },
        "atoReferencia": { "$ref": "#/$defs/ReferenciaAto" },
        "livro": { "type": "string", "minLength": 1, "maxLength": 25 },
        "folha": { "type": "string", "minLength": 1, "maxLength": 25 },
        "termo": { "type": "integer", "minimum": 0, "maximum": 9999999999 },
        "matriculaNacional": { "type": "string", "pattern": "^\\d{32}$" },
        "tipoLivro": { "type": "string", "pattern": "^[1-9]$" },
        "ordemJudicial": { "type": "boolean" },
        "numeroProcessoJudicial": { "type": "string", "minLength": 1, "maxLength": 25 },
        "dataSentencaDecisao": { "type": "string", "format": "date" },
        "observacoes": { "type": "string", "minLength": 2, "maxLength": 4000 },
        "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}$" },
        "tipoAverbacaoAto": {
          "type": "string",
          "enum": ["AVERBACAO_CASAMENTO", "AVERBACAO_TRANSCRICAO_CASAMENTO"],
          "description": "RAC=AVERBACAO_CASAMENTO, RATC=AVERBACAO_TRANSCRICAO_CASAMENTO."
        },
        "tipoAverbacao": {
          "type": "string",
          "enum": [
            "DIVORCIO",
            "SEPARACAO_JUDICIAL",
            "RESTABELECIMENTO_SOCIEDADE_CONJUGAL",
            "ANULACAO_NULIDADE_CASAMENTO",
            "ALTERACAO_REGIME_BENS",
            "ALTERACAO_NOME",
            "RETIFICACAO",
            "OUTROS"
          ],
          "description": "C1, C2, C3, C4, C5, C7, C8, C9 humanizados (sem C6)."
        },
        "conjuges": { "type": "array", "minItems": 2, "maxItems": 2, "items": { "$ref": "#/$defs/Pessoa" } },
        "atosVinculados": { "type": "array", "minItems": 1, "items": { "$ref": "#/$defs/AtoVinculado" } },
        "emolumentos": { "$ref": "#/$defs/Emolumentos" }
      }
    },

    "RegistroObito": {
      "type": "object",
      "title": "Registro de Obito",
      "description": "Lavra do termo de obito no Livro C. Lei 6.015/1973 art. 77.",
      "additionalProperties": false,
      "required": ["categoria", "dataPratica", "selo", "aleatorio", "tipoAto", "dataObito", "caracteristica", "tipoDocumento", "emolumentos"],
      "allOf": [{ "$ref": "#/$defs/AtoBase" }],
      "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}$" },
        "atoOriginal": { "$ref": "#/$defs/ReferenciaAto" },
        "atoReferencia": { "$ref": "#/$defs/ReferenciaAto" },
        "livro": { "type": "string", "minLength": 1, "maxLength": 25 },
        "folha": { "type": "string", "minLength": 1, "maxLength": 25 },
        "termo": { "type": "integer", "minimum": 0, "maximum": 9999999999 },
        "matriculaNacional": { "type": "string", "pattern": "^\\d{32}$" },
        "tipoLivro": { "type": "string", "pattern": "^[1-9]$" },
        "ordemJudicial": { "type": "boolean" },
        "numeroProcessoJudicial": { "type": "string", "minLength": 1, "maxLength": 25 },
        "dataSentencaDecisao": { "type": "string", "format": "date" },
        "observacoes": { "type": "string", "minLength": 2, "maxLength": 4000 },
        "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}$" },
        "tipoAto": {
          "type": "string",
          "enum": ["REGISTRO_OBITO", "REGISTRO_TRANSCRICAO_OBITO"],
          "description": "RRO=REGISTRO_OBITO, RRTO=REGISTRO_TRANSCRICAO_OBITO."
        },
        "dataObito": { "type": "string", "format": "date" },
        "horaObito": { "type": "string", "pattern": "^([01]\\d|2[0-3]):[0-5]\\d$" },
        "tipoLocalObito": {
          "type": "string",
          "enum": ["UNIDADE_DE_SAUDE", "VIA_PUBLICA", "DOMICILIO", "OUTROS", "IGNORADO"],
          "description": "1..5 do XSD humanizados (NUNCA HOSPITAL para 1)."
        },
        "descricaoTipoLocalObito": { "type": "string", "minLength": 2, "maxLength": 250, "description": "Obrigatoria quando tipoLocalObito=OUTROS." },
        "lugarObito": { "type": "string", "minLength": 2, "maxLength": 500 },
        "lugarSepultamento": { "type": "string", "minLength": 2, "maxLength": 255 },
        "caracteristica": {
          "type": "string",
          "enum": ["INDIGENTE", "MENOR", "NATIMORTO", "MAIOR"],
          "description": "1..4 do XSD humanizados."
        },
        "causaMorte": { "type": "string", "minLength": 2, "maxLength": 255 },
        "tipoMorte": { "type": "string", "enum": ["NATURAL", "VIOLENTO"], "description": "1=NATURAL, 2=VIOLENTO (NUNCA NAO_NATURAL)." },
        "corPele": {
          "type": "string",
          "enum": ["BRANCA", "PRETA", "AMARELA", "PARDA", "INDIGENA"],
          "description": "1..5 humanizados."
        },
        "eleitor": { "type": "boolean", "description": "Indica se era eleitor (S/N)." },
        "tipoDocumento": {
          "type": "string",
          "enum": ["DECLARACAO_OBITO", "ORDEM_JUDICIAL", "TESTEMUNHAS", "OUTROS"],
          "description": "1=DECLARACAO_OBITO, 2=ORDEM_JUDICIAL, 3=TESTEMUNHAS, 4=OUTROS."
        },
        "descricaoDocumento": { "type": "string", "minLength": 2, "maxLength": 250 },
        "numeroDocumento": { "type": "string", "minLength": 1, "maxLength": 25 },
        "protocoloConsultaObito": { "type": "string", "minLength": 1, "maxLength": 25 },
        "nomeAtestantePrimario": { "type": "string", "minLength": 2, "maxLength": 250 },
        "falecido": { "$ref": "#/$defs/Pessoa" },
        "descricaoTranscricao": { "$ref": "#/$defs/DescricaoTranscricao" },
        "testemunhas": { "type": "array", "minItems": 1, "maxItems": 2, "items": { "$ref": "#/$defs/Pessoa" } },
        "enderecoObito": { "$ref": "#/$defs/Endereco" },
        "beneficiosPrevidenciarios": { "type": "array", "minItems": 1, "items": { "$ref": "#/$defs/BeneficioPrevidenciario" } },
        "declarante": { "$ref": "#/$defs/Declarante" },
        "impressosSeguranca": { "type": "array", "minItems": 1, "items": { "$ref": "#/$defs/ImpressoSeguranca" } },
        "emolumentos": { "$ref": "#/$defs/Emolumentos" }
      }
    },

    "CertidaoObito": {
      "type": "object",
      "title": "Certidao de Obito",
      "description": "Certidao de obito (RCO, RCTO, RCUIO).",
      "additionalProperties": false,
      "required": ["categoria", "dataPratica", "selo", "aleatorio", "tipoCertidao", "interligacao", "inteiroTeor", "emolumentos"],
      "allOf": [{ "$ref": "#/$defs/AtoBase" }],
      "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}$" },
        "atoOriginal": { "$ref": "#/$defs/ReferenciaAto" },
        "atoReferencia": { "$ref": "#/$defs/ReferenciaAto" },
        "livro": { "type": "string", "minLength": 1, "maxLength": 25 },
        "folha": { "type": "string", "minLength": 1, "maxLength": 25 },
        "termo": { "type": "integer", "minimum": 0, "maximum": 9999999999 },
        "matriculaNacional": { "type": "string", "pattern": "^\\d{32}$" },
        "tipoLivro": { "type": "string", "pattern": "^[1-9]$" },
        "ordemJudicial": { "type": "boolean" },
        "numeroProcessoJudicial": { "type": "string", "minLength": 1, "maxLength": 25 },
        "dataSentencaDecisao": { "type": "string", "format": "date" },
        "observacoes": { "type": "string", "minLength": 2, "maxLength": 4000 },
        "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": "string",
          "enum": ["CERTIDAO_OBITO", "CERTIDAO_TRANSCRICAO_OBITO", "CERTIDAO_INTEIRO_TEOR_OBITO"],
          "description": "RCO/RCTO/RCUIO humanizados."
        },
        "dataObito": { "type": "string", "format": "date" },
        "interligacao": { "type": "boolean" },
        "inteiroTeor": { "type": "boolean" },
        "falecido": { "$ref": "#/$defs/Pessoa" },
        "emolumentos": { "$ref": "#/$defs/Emolumentos" }
      }
    },

    "AverbacaoObito": {
      "type": "object",
      "title": "Averbacao de Obito",
      "description": "Averbacao em assento de obito (Livro C).",
      "additionalProperties": false,
      "required": ["categoria", "dataPratica", "selo", "aleatorio", "tipoAverbacaoAto", "tipoAverbacao", "falecido", "emolumentos"],
      "allOf": [{ "$ref": "#/$defs/AtoBase" }],
      "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}$" },
        "atoOriginal": { "$ref": "#/$defs/ReferenciaAto" },
        "atoReferencia": { "$ref": "#/$defs/ReferenciaAto" },
        "livro": { "type": "string", "minLength": 1, "maxLength": 25 },
        "folha": { "type": "string", "minLength": 1, "maxLength": 25 },
        "termo": { "type": "integer", "minimum": 0, "maximum": 9999999999 },
        "matriculaNacional": { "type": "string", "pattern": "^\\d{32}$" },
        "tipoLivro": { "type": "string", "pattern": "^[1-9]$" },
        "ordemJudicial": { "type": "boolean" },
        "numeroProcessoJudicial": { "type": "string", "minLength": 1, "maxLength": 25 },
        "dataSentencaDecisao": { "type": "string", "format": "date" },
        "observacoes": { "type": "string", "minLength": 2, "maxLength": 4000 },
        "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}$" },
        "tipoAverbacaoAto": {
          "type": "string",
          "enum": ["AVERBACAO_OBITO", "AVERBACAO_TRANSCRICAO_OBITO"],
          "description": "RAO=AVERBACAO_OBITO, RATO=AVERBACAO_TRANSCRICAO_OBITO."
        },
        "tipoAverbacao": {
          "type": "string",
          "enum": ["RETIFICACAO", "ALTERACAO_NOME", "ALTERACAO_DATA_OBITO", "CANCELAMENTO", "OUTROS"],
          "description": "O1..O5 humanizados."
        },
        "falecido": { "$ref": "#/$defs/Pessoa" },
        "atosVinculados": { "type": "array", "minItems": 1, "items": { "$ref": "#/$defs/AtoVinculado" } },
        "emolumentos": { "$ref": "#/$defs/Emolumentos" }
      }
    },

    "RegistroEditalProclamas": {
      "type": "object",
      "title": "Registro de Edital de Proclamas",
      "description": "Transmissao nao selada do edital de proclamas.",
      "additionalProperties": false,
      "required": ["categoria", "dataPratica", "cct", "listaNomes", "emolumentos"],
      "allOf": [{ "$ref": "#/$defs/TransmissaoBase" }],
      "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}$" },
        "codigoServico": { "type": "string", "pattern": "^\\d{1,5}$" },
        "nomeServicoEmissor": { "type": "string", "minLength": 2, "maxLength": 250 },
        "estadoServicoEmissor": { "type": "string", "minLength": 2, "maxLength": 2 },
        "listaNomes": { "type": "array", "minItems": 1, "items": { "$ref": "#/$defs/Pessoa" } },
        "emolumentos": { "$ref": "#/$defs/Emolumentos" }
      }
    },

    "CertidaoEditalProclamas": {
      "type": "object",
      "title": "Certidao de Edital de Proclamas",
      "description": "Certidao do edital de proclamas.",
      "additionalProperties": false,
      "required": ["categoria", "dataPratica", "selo", "aleatorio", "listaNomes", "emolumentos"],
      "allOf": [{ "$ref": "#/$defs/AtoBase" }],
      "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}$" },
        "atoOriginal": { "$ref": "#/$defs/ReferenciaAto" },
        "atoReferencia": { "$ref": "#/$defs/ReferenciaAto" },
        "livro": { "type": "string", "minLength": 1, "maxLength": 25 },
        "folha": { "type": "string", "minLength": 1, "maxLength": 25 },
        "termo": { "type": "integer", "minimum": 0, "maximum": 9999999999 },
        "matriculaNacional": { "type": "string", "pattern": "^\\d{32}$" },
        "tipoLivro": { "type": "string", "pattern": "^[1-9]$" },
        "ordemJudicial": { "type": "boolean" },
        "numeroProcessoJudicial": { "type": "string", "minLength": 1, "maxLength": 25 },
        "dataSentencaDecisao": { "type": "string", "format": "date" },
        "observacoes": { "type": "string", "minLength": 2, "maxLength": 4000 },
        "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}$" },
        "listaNomes": { "type": "array", "minItems": 1, "items": { "$ref": "#/$defs/Pessoa" } },
        "atosVinculados": { "type": "array", "minItems": 1, "items": { "$ref": "#/$defs/AtoVinculado" } },
        "emolumentos": { "$ref": "#/$defs/Emolumentos" }
      }
    },

    "ProcessoAdministrativo": {
      "type": "object",
      "title": "Processo Administrativo",
      "description": "Processo administrativo lavrado no servico (P1..P9).",
      "additionalProperties": false,
      "required": ["categoria", "dataPratica", "selo", "aleatorio", "tipoRegistro", "listaNomes", "emolumentos"],
      "allOf": [{ "$ref": "#/$defs/AtoBase" }],
      "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}$" },
        "atoOriginal": { "$ref": "#/$defs/ReferenciaAto" },
        "atoReferencia": { "$ref": "#/$defs/ReferenciaAto" },
        "livro": { "type": "string", "minLength": 1, "maxLength": 25 },
        "folha": { "type": "string", "minLength": 1, "maxLength": 25 },
        "termo": { "type": "integer", "minimum": 0, "maximum": 9999999999 },
        "matriculaNacional": { "type": "string", "pattern": "^\\d{32}$" },
        "tipoLivro": { "type": "string", "pattern": "^[1-9]$" },
        "ordemJudicial": { "type": "boolean" },
        "numeroProcessoJudicial": { "type": "string", "minLength": 1, "maxLength": 25 },
        "dataSentencaDecisao": { "type": "string", "format": "date" },
        "observacoes": { "type": "string", "minLength": 2, "maxLength": 4000 },
        "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": "string",
          "enum": [
            "RESTAURACAO_REGISTRO",
            "RETIFICACAO_REGISTRO",
            "RECONHECIMENTO_PATERNIDADE_VOLUNTARIA",
            "ADOCAO_BRASIL_VAZIO_LEGAL",
            "REGISTRO_TARDIO_NASCIMENTO",
            "TRANSCRICAO_NASCIMENTO_BRASILEIRO_NO_ESTRANGEIRO",
            "TRANSCRICAO_OBITO_BRASILEIRO_NO_ESTRANGEIRO",
            "TRANSCRICAO_CASAMENTO_BRASILEIRO_NO_ESTRANGEIRO"
          ],
          "description": "P1, P2, P3, P4, P5, P7, P8, P9 humanizados (sem P6)."
        },
        "listaNomes": { "type": "array", "minItems": 1, "items": { "$ref": "#/$defs/Pessoa" } },
        "emolumentos": { "$ref": "#/$defs/Emolumentos" }
      }
    },

    "CertidaoCRC": {
      "type": "object",
      "title": "Certidao CRC",
      "description": "Certidao expedida pelo modulo CRC (Central de Registros Civis - estadual).",
      "additionalProperties": false,
      "required": ["categoria", "dataPratica", "selo", "aleatorio", "tipoRegistro", "listaNomes", "emolumentos"],
      "allOf": [{ "$ref": "#/$defs/AtoBase" }],
      "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}$" },
        "atoOriginal": { "$ref": "#/$defs/ReferenciaAto" },
        "atoReferencia": { "$ref": "#/$defs/ReferenciaAto" },
        "livro": { "type": "string", "minLength": 1, "maxLength": 25 },
        "folha": { "type": "string", "minLength": 1, "maxLength": 25 },
        "termo": { "type": "integer", "minimum": 0, "maximum": 9999999999 },
        "matriculaNacional": { "type": "string", "pattern": "^\\d{32}$" },
        "tipoLivro": { "type": "string", "pattern": "^[1-9]$" },
        "ordemJudicial": { "type": "boolean" },
        "numeroProcessoJudicial": { "type": "string", "minLength": 1, "maxLength": 25 },
        "dataSentencaDecisao": { "type": "string", "format": "date" },
        "observacoes": { "type": "string", "minLength": 2, "maxLength": 4000 },
        "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": "string",
          "enum": [
            "CERTIDAO_NASCIMENTO",
            "CERTIDAO_OBITO",
            "CERTIDAO_CASAMENTO",
            "CERTIDAO_NASCIMENTO_TRANSCRICAO",
            "CERTIDAO_OBITO_TRANSCRICAO",
            "CERTIDAO_CASAMENTO_TRANSCRICAO",
            "CERTIDAO_LIVRO_E",
            "CERTIDAO_INTEIRO_TEOR",
            "CERTIDAO_GENERICA_RCPN",
            "CERTIDAO_GENERICA_INTEIRO_TEOR"
          ],
          "description": "CN, CO, CC, CNT, COT, CCT, CLE, CIT, CGRCPN, CGIT humanizados."
        },
        "listaNomes": { "type": "array", "minItems": 1, "items": { "$ref": "#/$defs/Pessoa" } },
        "emolumentos": { "$ref": "#/$defs/Emolumentos" }
      }
    },

    "CertidaoCRCNacional": {
      "type": "object",
      "title": "Certidao CRC Nacional",
      "description": "Certidao expedida pelo modulo CRC Nacional (CNJ Provimento 46/2015).",
      "additionalProperties": false,
      "required": ["categoria", "dataPratica", "selo", "aleatorio", "tipoRegistro", "listaNomes", "emolumentos"],
      "allOf": [{ "$ref": "#/$defs/AtoBase" }],
      "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}$" },
        "atoOriginal": { "$ref": "#/$defs/ReferenciaAto" },
        "atoReferencia": { "$ref": "#/$defs/ReferenciaAto" },
        "livro": { "type": "string", "minLength": 1, "maxLength": 25 },
        "folha": { "type": "string", "minLength": 1, "maxLength": 25 },
        "termo": { "type": "integer", "minimum": 0, "maximum": 9999999999 },
        "matriculaNacional": { "type": "string", "pattern": "^\\d{32}$" },
        "tipoLivro": { "type": "string", "pattern": "^[1-9]$" },
        "ordemJudicial": { "type": "boolean" },
        "numeroProcessoJudicial": { "type": "string", "minLength": 1, "maxLength": 25 },
        "dataSentencaDecisao": { "type": "string", "format": "date" },
        "observacoes": { "type": "string", "minLength": 2, "maxLength": 4000 },
        "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": "string",
          "enum": [
            "CERTIDAO_NASCIMENTO",
            "CERTIDAO_OBITO",
            "CERTIDAO_CASAMENTO",
            "CERTIDAO_NASCIMENTO_TRANSCRICAO",
            "CERTIDAO_OBITO_TRANSCRICAO",
            "CERTIDAO_CASAMENTO_TRANSCRICAO",
            "CERTIDAO_LIVRO_E",
            "CERTIDAO_INTEIRO_TEOR",
            "CERTIDAO_GENERICA_RCPN",
            "CERTIDAO_GENERICA_INTEIRO_TEOR"
          ],
          "description": "CN, CO, CC, CNT, COT, CCT, CLE, CIT, CGRCPN, CGIT humanizados."
        },
        "listaNomes": { "type": "array", "minItems": 1, "items": { "$ref": "#/$defs/Pessoa" } },
        "atosVinculados": { "type": "array", "minItems": 1, "items": { "$ref": "#/$defs/AtoVinculado" } },
        "emolumentos": { "$ref": "#/$defs/Emolumentos" }
      }
    },

    "RegistroLivroE": {
      "type": "object",
      "title": "Registro no Livro E",
      "description": "Lavra de termo no Livro E (assentos diversos: emancipacao, interdicao, opcao de nacionalidade, etc.).",
      "additionalProperties": false,
      "required": ["categoria", "dataPratica", "selo", "aleatorio", "tipoRegistro", "participantes", "emolumentos"],
      "allOf": [{ "$ref": "#/$defs/AtoBase" }],
      "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}$" },
        "atoOriginal": { "$ref": "#/$defs/ReferenciaAto" },
        "atoReferencia": { "$ref": "#/$defs/ReferenciaAto" },
        "livro": { "type": "string", "minLength": 1, "maxLength": 25 },
        "folha": { "type": "string", "minLength": 1, "maxLength": 25 },
        "termo": { "type": "integer", "minimum": 0, "maximum": 9999999999 },
        "matriculaNacional": { "type": "string", "pattern": "^\\d{32}$" },
        "tipoLivro": { "type": "string", "pattern": "^[1-9]$" },
        "ordemJudicial": { "type": "boolean" },
        "numeroProcessoJudicial": { "type": "string", "minLength": 1, "maxLength": 25 },
        "dataSentencaDecisao": { "type": "string", "format": "date" },
        "observacoes": { "type": "string", "minLength": 2, "maxLength": 4000 },
        "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}$" },
        "processo": { "type": "string", "minLength": 1, "maxLength": 25 },
        "juizo": { "type": "string", "minLength": 2, "maxLength": 250 },
        "comarca": { "type": "integer", "minimum": 1, "maximum": 9999, "description": "Codigo da comarca CGJ-RJ (4 digitos)." },
        "tipoRegistro": {
          "type": "string",
          "enum": [
            "EMANCIPACAO",
            "INTERDICAO",
            "AUSENCIA",
            "MORTE_PRESUMIDA",
            "SENTENCA_SEPARACAO_JUDICIAL",
            "SENTENCA_DIVORCIO",
            "OPCAO_NACIONALIDADE",
            "TERMO_TUTELA_CURATELA",
            "ATOS_RELATIVOS_UNIAO_ESTAVEL",
            "OUTROS_ASSENTOS_LIVRO_E",
            "REGISTRO_PESSOA_NATURAL_INDIGENA",
            "REGISTRO_FILIACAO_SOCIOAFETIVA"
          ],
          "description": "E1..E10 humanizados (12 valores reportados em §10 cobrem variantes locais)."
        },
        "participantes": { "type": "array", "minItems": 1, "items": { "$ref": "#/$defs/Pessoa" } },
        "atosVinculados": { "type": "array", "minItems": 1, "items": { "$ref": "#/$defs/AtoVinculado" } },
        "emolumentos": { "$ref": "#/$defs/Emolumentos" }
      }
    },

    "CertidaoLivroE": {
      "type": "object",
      "title": "Certidao do Livro E",
      "description": "Certidao expedida sobre assento do Livro E.",
      "additionalProperties": false,
      "required": ["categoria", "dataPratica", "selo", "aleatorio", "participantes", "emolumentos"],
      "allOf": [{ "$ref": "#/$defs/AtoBase" }],
      "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}$" },
        "atoOriginal": { "$ref": "#/$defs/ReferenciaAto" },
        "atoReferencia": { "$ref": "#/$defs/ReferenciaAto" },
        "livro": { "type": "string", "minLength": 1, "maxLength": 25 },
        "folha": { "type": "string", "minLength": 1, "maxLength": 25 },
        "termo": { "type": "integer", "minimum": 0, "maximum": 9999999999 },
        "matriculaNacional": { "type": "string", "pattern": "^\\d{32}$" },
        "tipoLivro": { "type": "string", "pattern": "^[1-9]$" },
        "ordemJudicial": { "type": "boolean" },
        "numeroProcessoJudicial": { "type": "string", "minLength": 1, "maxLength": 25 },
        "dataSentencaDecisao": { "type": "string", "format": "date" },
        "observacoes": { "type": "string", "minLength": 2, "maxLength": 4000 },
        "indCertidaoEletronica": { "type": "boolean" },
        "indAtoEletronico": { "type": "boolean" },
        "urlPdfAto": { "type": "string", "format": "uri", "minLength": 2, "maxLength": 2083 },
        "hashPdfAto": { "type": "string", "pattern": "^[A-Fa-f0-9]{64}$" },
        "urlDossie": { "type": "string", "format": "uri", "minLength": 2, "maxLength": 2083 },
        "hashDossie": { "type": "string", "pattern": "^[A-Fa-f0-9]{64}$" },
        "participantes": { "type": "array", "minItems": 1, "items": { "$ref": "#/$defs/Pessoa" } },
        "emolumentos": { "$ref": "#/$defs/Emolumentos" }
      }
    },

    "AverbacaoLivroE": {
      "type": "object",
      "title": "Averbacao no Livro E",
      "description": "Averbacao em assento do Livro E.",
      "additionalProperties": false,
      "required": ["categoria", "dataPratica", "selo", "aleatorio", "participantes", "emolumentos"],
      "allOf": [{ "$ref": "#/$defs/AtoBase" }],
      "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}$" },
        "atoOriginal": { "$ref": "#/$defs/ReferenciaAto" },
        "atoReferencia": { "$ref": "#/$defs/ReferenciaAto" },
        "livro": { "type": "string", "minLength": 1, "maxLength": 25 },
        "folha": { "type": "string", "minLength": 1, "maxLength": 25 },
        "termo": { "type": "integer", "minimum": 0, "maximum": 9999999999 },
        "matriculaNacional": { "type": "string", "pattern": "^\\d{32}$" },
        "tipoLivro": { "type": "string", "pattern": "^[1-9]$" },
        "ordemJudicial": { "type": "boolean" },
        "numeroProcessoJudicial": { "type": "string", "minLength": 1, "maxLength": 25 },
        "dataSentencaDecisao": { "type": "string", "format": "date" },
        "observacoes": { "type": "string", "minLength": 2, "maxLength": 4000 },
        "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": "string",
          "enum": [
            "EMANCIPACAO",
            "INTERDICAO",
            "AUSENCIA",
            "MORTE_PRESUMIDA",
            "SENTENCA_SEPARACAO_JUDICIAL",
            "SENTENCA_DIVORCIO",
            "OPCAO_NACIONALIDADE",
            "TERMO_TUTELA_CURATELA",
            "RESTABELECIMENTO_SOCIEDADE_CONJUGAL",
            "REVOGACAO_INTERDICAO"
          ],
          "description": "E1..E8, E11, E12 humanizados."
        },
        "participantes": { "type": "array", "minItems": 1, "items": { "$ref": "#/$defs/Pessoa" } },
        "atosVinculados": { "type": "array", "minItems": 1, "items": { "$ref": "#/$defs/AtoVinculado" } },
        "emolumentos": { "$ref": "#/$defs/Emolumentos" }
      }
    },

    "CertidaoGenerica": {
      "type": "object",
      "title": "Certidao Generica",
      "description": "Certidoes genericas RCPN (G1..G7).",
      "additionalProperties": false,
      "required": ["categoria", "dataPratica", "selo", "aleatorio", "tipoCertidao", "negativa", "participantes", "emolumentos"],
      "allOf": [{ "$ref": "#/$defs/AtoBase" }],
      "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}$" },
        "atoOriginal": { "$ref": "#/$defs/ReferenciaAto" },
        "atoReferencia": { "$ref": "#/$defs/ReferenciaAto" },
        "livro": { "type": "string", "minLength": 1, "maxLength": 25 },
        "folha": { "type": "string", "minLength": 1, "maxLength": 25 },
        "termo": { "type": "integer", "minimum": 0, "maximum": 9999999999 },
        "matriculaNacional": { "type": "string", "pattern": "^\\d{32}$" },
        "tipoLivro": { "type": "string", "pattern": "^[1-9]$" },
        "ordemJudicial": { "type": "boolean" },
        "numeroProcessoJudicial": { "type": "string", "minLength": 1, "maxLength": 25 },
        "dataSentencaDecisao": { "type": "string", "format": "date" },
        "observacoes": { "type": "string", "minLength": 2, "maxLength": 4000 },
        "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": "string",
          "enum": [
            "BUSCA_LIVROS",
            "BUSCA_TIPO_LIVRO",
            "INTEIRO_TEOR_DOCUMENTO_ARQUIVO",
            "FOTOCOPIA_DOCUMENTO_ARQUIVO",
            "CERTIDAO_VIDA_RCPN",
            "CERTIDAO_NEGATIVA_GENERICA",
            "OUTRAS_CERTIDOES"
          ],
          "description": "G1..G7 humanizados."
        },
        "negativa": { "type": "boolean", "description": "Indica certidao negativa." },
        "participantes": { "type": "array", "minItems": 1, "items": { "$ref": "#/$defs/Pessoa" } },
        "atosVinculados": { "type": "array", "minItems": 1, "items": { "$ref": "#/$defs/AtoVinculado" } },
        "emolumentos": { "$ref": "#/$defs/Emolumentos" }
      }
    },

    "Visto": {
      "type": "object",
      "title": "Visto em Habilitacao",
      "description": "Visto/revalidacao em habilitacao de casamento.",
      "additionalProperties": false,
      "required": ["categoria", "dataPratica", "selo", "aleatorio", "revalidada", "consultado", "emolumentos"],
      "allOf": [{ "$ref": "#/$defs/AtoBase" }],
      "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}$" },
        "atoOriginal": { "$ref": "#/$defs/ReferenciaAto" },
        "atoReferencia": { "$ref": "#/$defs/ReferenciaAto" },
        "livro": { "type": "string", "minLength": 1, "maxLength": 25 },
        "folha": { "type": "string", "minLength": 1, "maxLength": 25 },
        "termo": { "type": "integer", "minimum": 0, "maximum": 9999999999 },
        "matriculaNacional": { "type": "string", "pattern": "^\\d{32}$" },
        "tipoLivro": { "type": "string", "pattern": "^[1-9]$" },
        "ordemJudicial": { "type": "boolean" },
        "numeroProcessoJudicial": { "type": "string", "minLength": 1, "maxLength": 25 },
        "dataSentencaDecisao": { "type": "string", "format": "date" },
        "observacoes": { "type": "string", "minLength": 2, "maxLength": 4000 },
        "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": "Habilitacao revalidada (S/N humanizado)." },
        "consultado": { "$ref": "#/$defs/Pessoa" },
        "emolumentos": { "$ref": "#/$defs/Emolumentos" }
      }
    },

    "FolhaAdicionalComplemento": {
      "type": "object",
      "title": "Folha Adicional / Complemento",
      "description": "Transmissao nao selada de folhas adicionais a um ato selado original.",
      "additionalProperties": false,
      "required": ["categoria", "dataPratica", "cct", "atoOriginal", "qtdFolhasExcedentes", "emolumentos"],
      "allOf": [{ "$ref": "#/$defs/TransmissaoBase" }],
      "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}$" },
        "atoOriginal": {
          "type": "object",
          "additionalProperties": false,
          "required": ["selo", "aleatorio"],
          "properties": {
            "selo": { "type": "string", "pattern": "^[A-Z]{3,4}\\d{5}$" },
            "aleatorio": { "type": "string", "pattern": "^[A-Z]{3}$" }
          }
        },
        "qtdFolhasExcedentes": { "type": "integer", "minimum": 1, "maximum": 999999, "description": "Quantidade de folhas excedentes." },
        "emolumentos": { "$ref": "#/$defs/Emolumentos" }
      }
    },

    "InformacaoVerbal": {
      "type": "object",
      "title": "Informacao Verbal",
      "description": "Transmissao nao selada de informacao verbal.",
      "additionalProperties": false,
      "required": ["categoria", "dataPratica", "cct", "numeroAto", "nome", "emolumentos"],
      "allOf": [{ "$ref": "#/$defs/TransmissaoBase" }],
      "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 },
        "nome": { "type": "string", "minLength": 2, "maxLength": 200 },
        "emolumentos": { "$ref": "#/$defs/Emolumentos" }
      }
    },

    "ComplementoEmolumentos": {
      "type": "object",
      "title": "Complemento de Emolumentos",
      "description": "Transmissao nao selada de complemento de emolumentos a um ato selado.",
      "additionalProperties": false,
      "required": ["categoria", "dataPratica", "cct", "atosVinculados", "emolumentos"],
      "allOf": [{ "$ref": "#/$defs/TransmissaoBase" }],
      "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": "Operacao que altera os emolumentos de um ato selado existente, identificado pelo selo.",
      "additionalProperties": false,
      "required": ["categoria", "selo", "emolumentos"],
      "properties": {
        "categoria": { "type": "string", "const": "OPERACAO" },
        "selo": { "type": "string", "pattern": "^[A-Z]{4}\\d{5}$" },
        "emolumentos": { "$ref": "#/$defs/Emolumentos" }
      }
    },

    "AlteracaoUrlAtoEletronico": {
      "type": "object",
      "title": "Alteracao de URL do Ato Eletronico",
      "description": "Operacao que altera URLs de PDF/dossie de um ato selado existente.",
      "additionalProperties": false,
      "required": ["categoria", "selo"],
      "properties": {
        "categoria": { "type": "string", "const": "OPERACAO" },
        "selo": { "type": "string", "pattern": "^[A-Z]{4}\\d{5}$" },
        "urlPdfAto": { "type": "string", "format": "uri", "minLength": 2, "maxLength": 2083 },
        "urlDossie": { "type": "string", "format": "uri", "minLength": 2, "maxLength": 2083 }
      }
    },

    "MaterializacaoAtosDecisoriosFE": {
      "type": "object",
      "title": "Materializacao de Atos Decisorios em Forma Eletronica",
      "description": "Materializacao em papel de atos decisorios eletronicos.",
      "additionalProperties": false,
      "required": ["categoria", "dataPratica", "selo", "aleatorio", "origemDoc", "varaInfanciaJuventudeIdoso", "qtdTotalFolhas", "dataImpressao", "emolumentos"],
      "allOf": [{ "$ref": "#/$defs/AtoBase" }],
      "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}$" },
        "atoOriginal": { "$ref": "#/$defs/ReferenciaAto" },
        "atoReferencia": { "$ref": "#/$defs/ReferenciaAto" },
        "livro": { "type": "string", "minLength": 1, "maxLength": 25 },
        "folha": { "type": "string", "minLength": 1, "maxLength": 25 },
        "termo": { "type": "integer", "minimum": 0, "maximum": 9999999999 },
        "matriculaNacional": { "type": "string", "pattern": "^\\d{32}$" },
        "tipoLivro": { "type": "string", "pattern": "^[1-9]$" },
        "ordemJudicial": { "type": "boolean" },
        "numeroProcessoJudicial": { "type": "string", "minLength": 1, "maxLength": 25 },
        "dataSentencaDecisao": { "type": "string", "format": "date" },
        "observacoes": { "type": "string", "minLength": 2, "maxLength": 4000 },
        "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}$" },
        "origemDoc": { "type": "string", "enum": ["WEBSITE", "ARQUIVO"], "description": "W=WEBSITE, A=ARQUIVO." },
        "varaInfanciaJuventudeIdoso": { "type": "boolean" },
        "qtdTotalFolhas": { "type": "integer", "minimum": 1, "maximum": 999999 },
        "dataImpressao": {
          "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 da impressao (ISO 8601 com offset)."
        },
        "url": { "type": "string", "format": "uri", "minLength": 2, "maxLength": 2083 },
        "nomeArquivo": { "type": "string", "minLength": 2, "maxLength": 100 },
        "formatoArquivo": { "type": "string", "minLength": 2, "maxLength": 4 },
        "tamanhoArquivo": { "type": "integer", "minimum": 0, "maximum": 9999999999 },
        "emolumentos": { "$ref": "#/$defs/Emolumentos" }
      }
    },

    "Apostilamento": {
      "type": "object",
      "title": "Apostilamento (Apostila de Haia)",
      "description": "Aposicao de apostila em documento (Convencao da Haia, CNJ Resolucao 228/2016).",
      "additionalProperties": false,
      "required": ["categoria", "dataPratica", "selo", "aleatorio", "documento", "apostilador", "documentoApostilador", "participantes", "emolumentos"],
      "allOf": [{ "$ref": "#/$defs/AtoBase" }],
      "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}$" },
        "atoOriginal": { "$ref": "#/$defs/ReferenciaAto" },
        "atoReferencia": { "$ref": "#/$defs/ReferenciaAto" },
        "livro": { "type": "string", "minLength": 1, "maxLength": 25 },
        "folha": { "type": "string", "minLength": 1, "maxLength": 25 },
        "termo": { "type": "integer", "minimum": 0, "maximum": 9999999999 },
        "matriculaNacional": { "type": "string", "pattern": "^\\d{32}$" },
        "tipoLivro": { "type": "string", "pattern": "^[1-9]$" },
        "ordemJudicial": { "type": "boolean" },
        "numeroProcessoJudicial": { "type": "string", "minLength": 1, "maxLength": 25 },
        "dataSentencaDecisao": { "type": "string", "format": "date" },
        "observacoes": { "type": "string", "minLength": 2, "maxLength": 4000 },
        "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": "Tipo/identificacao do documento apostilado." },
        "apostilador": { "type": "string", "minLength": 2, "maxLength": 50, "description": "Nome do apostilador." },
        "documentoApostilador": { "type": "string", "minLength": 2, "maxLength": 25, "description": "Documento do apostilador." },
        "participantes": { "type": "array", "minItems": 1, "items": { "$ref": "#/$defs/Pessoa" } },
        "emolumentos": { "$ref": "#/$defs/Emolumentos" }
      }
    },

    "EncerramentoLivro": {
      "type": "object",
      "title": "Encerramento de Livro",
      "description": "Transmissao nao selada de encerramento de livro fisico.",
      "additionalProperties": false,
      "required": ["categoria", "dataPratica", "cct", "livro", "qtdTotalFolhas", "identificacaoLivro", "dataEncerramento"],
      "allOf": [{ "$ref": "#/$defs/TransmissaoBase" }],
      "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": 2, "maxLength": 25 },
        "qtdTotalFolhas": { "type": "integer", "minimum": 1, "maximum": 999999 },
        "identificacaoLivro": { "type": "string", "minLength": 2, "maxLength": 100 },
        "dataEncerramento": { "type": "string", "format": "date" }
      }
    },

    "DeclaratorioUniaoEstavel": {
      "type": "object",
      "title": "Declaratorio de Uniao Estavel",
      "description": "Termo declaratorio de uniao estavel (CNJ Provimento 37/2014).",
      "additionalProperties": false,
      "required": ["categoria", "dataPratica", "selo", "aleatorio", "regimeBens", "homoafetiva", "conviventes", "emolumentos"],
      "allOf": [{ "$ref": "#/$defs/AtoBase" }],
      "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}$" },
        "atoOriginal": { "$ref": "#/$defs/ReferenciaAto" },
        "atoReferencia": { "$ref": "#/$defs/ReferenciaAto" },
        "livro": { "type": "string", "minLength": 1, "maxLength": 25 },
        "folha": { "type": "string", "minLength": 1, "maxLength": 25 },
        "termo": { "type": "integer", "minimum": 0, "maximum": 9999999999 },
        "matriculaNacional": { "type": "string", "pattern": "^\\d{32}$" },
        "tipoLivro": { "type": "string", "pattern": "^[1-9]$" },
        "ordemJudicial": { "type": "boolean" },
        "numeroProcessoJudicial": { "type": "string", "minLength": 1, "maxLength": 25 },
        "dataSentencaDecisao": { "type": "string", "format": "date" },
        "observacoes": { "type": "string", "minLength": 2, "maxLength": 4000 },
        "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}$" },
        "dataInicioUniao": { "type": "string", "format": "date" },
        "regimeBens": {
          "type": "string",
          "enum": [
            "COMUNHAO_PARCIAL_BENS",
            "COMUNHAO_UNIVERSAL_BENS",
            "SEPARACAO_TOTAL_BENS",
            "PARTICIPACAO_FINAL_AQUESTOS",
            "SEPARACAO_OBRIGATORIA_BENS"
          ]
        },
        "homoafetiva": { "type": "boolean" },
        "conviventes": { "type": "array", "minItems": 2, "maxItems": 2, "items": { "$ref": "#/$defs/Pessoa" } },
        "emolumentos": { "$ref": "#/$defs/Emolumentos" }
      }
    },

    "DissolucaoUniaoEstavel": {
      "type": "object",
      "title": "Dissolucao de Uniao Estavel",
      "description": "Termo de dissolucao de uniao estavel.",
      "additionalProperties": false,
      "required": ["categoria", "dataPratica", "selo", "aleatorio", "decisaoJudicial", "regimeBens", "partilhaBens", "homoafetiva", "conviventes", "emolumentos"],
      "allOf": [{ "$ref": "#/$defs/AtoBase" }],
      "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}$" },
        "atoOriginal": { "$ref": "#/$defs/ReferenciaAto" },
        "atoReferencia": { "$ref": "#/$defs/ReferenciaAto" },
        "livro": { "type": "string", "minLength": 1, "maxLength": 25 },
        "folha": { "type": "string", "minLength": 1, "maxLength": 25 },
        "termo": { "type": "integer", "minimum": 0, "maximum": 9999999999 },
        "matriculaNacional": { "type": "string", "pattern": "^\\d{32}$" },
        "tipoLivro": { "type": "string", "pattern": "^[1-9]$" },
        "ordemJudicial": { "type": "boolean" },
        "numeroProcessoJudicial": { "type": "string", "minLength": 1, "maxLength": 25 },
        "dataSentencaDecisao": { "type": "string", "format": "date" },
        "observacoes": { "type": "string", "minLength": 2, "maxLength": 4000 },
        "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}$" },
        "dataInicioUniao": { "type": "string", "format": "date" },
        "dataFimUniao": { "type": "string", "format": "date" },
        "decisaoJudicial": { "type": "boolean", "description": "Houve decisao judicial (IndDecisaoJudicial S/N)." },
        "regimeBens": {
          "type": "string",
          "enum": [
            "COMUNHAO_PARCIAL_BENS",
            "COMUNHAO_UNIVERSAL_BENS",
            "SEPARACAO_TOTAL_BENS",
            "PARTICIPACAO_FINAL_AQUESTOS",
            "SEPARACAO_OBRIGATORIA_BENS"
          ]
        },
        "partilhaBens": { "type": "boolean", "description": "Houve partilha de bens." },
        "homoafetiva": { "type": "boolean" },
        "conviventes": { "type": "array", "minItems": 2, "maxItems": 2, "items": { "$ref": "#/$defs/Pessoa" } },
        "emolumentos": { "$ref": "#/$defs/Emolumentos" }
      }
    }

  }
}
