diff --git a/.github/codeql/codeql-config.yml b/.github/codeql/codeql-config.yml
new file mode 100644
index 0000000..4d5677d
--- /dev/null
+++ b/.github/codeql/codeql-config.yml
@@ -0,0 +1,8 @@
+name: "Configuracao do CodeQL"
+
+# Arquivos de teste usam certificados autoassinados e chaves fracas de
+# proposito (servidor mTLS local, senhas de fixture) - padroes que disparariam
+# alertas de seguranca que nao se aplicam fora de teste. O codigo de producao
+# (fora de src/**/*.teste.ts) continua totalmente analisado.
+paths-ignore:
+ - '**/*.teste.ts'
diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml
index ace09d0..91912e1 100644
--- a/.github/workflows/codeql.yml
+++ b/.github/workflows/codeql.yml
@@ -28,6 +28,7 @@ jobs:
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
+ config-file: ./.github/codeql/codeql-config.yml
- name: Analisar
uses: github/codeql-action/analyze@v3
diff --git a/README.md b/README.md
index ecef5ef..fe538fa 100644
--- a/README.md
+++ b/README.md
@@ -15,7 +15,7 @@ Em desenvolvimento inicial. A tabela abaixo reflete o estado real de cada módul
| `certificado` | Leitura de certificado A1 (.pfx/.p12) | Feito |
| `assinatura` | Assinatura XML (XMLDSig) | Feito |
| `dps` | Tipos e serialização da DPS, incluindo o bloco IBSCBS (XML validado contra o XSD oficial) | Feito; grupo gReeRepRes (reembolso/repasse/ressarcimento de terceiros) ainda não |
-| `cliente` | Cliente HTTP mTLS para o SEFIN Nacional (produção e homologação) | Feito; endpoints do ADN (DFe, parametrização) ainda não |
+| `cliente` | Cliente HTTP mTLS para o SEFIN Nacional e o ADN (produção e homologação) | Feito |
| `danfse` | Geração do DANFSe em PDF (NT 008/2026) | Feito; canhoto e dedução por documento ficam pra depois |
## Por que este projeto existe
@@ -32,6 +32,7 @@ O restante do SDK (certificado, assinatura, cliente HTTP) existe porque é pré-
- [nfse-nacional/nfse-php](https://github.com/nfse-nacional/nfse-php): usado como referência de escopo e organização.
- [Nota Técnica nº 008 (DANFSe)](https://www.gov.br/nfse/pt-br/biblioteca/documentacao-tecnica/rtc/nt-008-se-cgnfse-danfse-20260714-v1-02.pdf): especificação oficial usada como fonte do leiaute do DANFSe.
- [Esquemas XSD da NFS-e Nacional](https://www.gov.br/nfse/pt-br/biblioteca/documentacao-tecnica/documentacao-atual/nfse-esquemas_xsd-v1-01-20260209.zip): baixados direto do gov.br e versionados em [`schemas/nfse/v1.01`](schemas/nfse/v1.01) - fonte de verdade dos tipos e da serialização da DPS, e usados nos testes pra validar o XML gerado contra o schema oficial.
+- Especificações OpenAPI do ADN (Ambiente de Dados Nacional) e do SEFIN Nacional: baixadas direto do gov.br e versionadas em [`schemas/adn/v1`](schemas/adn/v1) - fonte de verdade dos endpoints do módulo `cliente`.
- [Liberation Sans](https://github.com/liberationfonts/liberation-fonts) e [DejaVu Sans](https://dejavu-fonts.github.io/): fontes livres embutidas no gerador de DANFSe (substitutas de Arial e Microsoft Sans Serif, que são proprietárias e não podem ser redistribuídas). Licenças em [`assets/fonts`](assets/fonts).
## Especificações
@@ -41,6 +42,7 @@ O restante do SDK (certificado, assinatura, cliente HTTP) existe porque é pré-
- NFS-e Nacional - Esquemas XML v1.01 - [gov.br/nfse](https://www.gov.br/nfse/pt-br/biblioteca/documentacao-tecnica/documentacao-atual/nfse-esquemas_xsd-v1-01-20260209.zip)
- DANFSe - Nota Técnica nº 008, versão 1.02 - [gov.br/nfse](https://www.gov.br/nfse/pt-br/biblioteca/documentacao-tecnica/rtc/nt-008-se-cgnfse-danfse-20260714-v1-02.pdf)
+- API do ADN (Contribuinte e Parâmetros Municipais) e do SEFIN Nacional - [gov.br/nfse](https://www.gov.br/nfse/pt-br/biblioteca/documentacao-tecnica/apis-prod-restrita-e-producao)
- XML Signature (XMLDSig) - [W3C](https://www.w3.org/TR/xmldsig-core1/), conforme exigido pelo contrato da DPS
diff --git a/package.json b/package.json
index 401e769..114b3a5 100644
--- a/package.json
+++ b/package.json
@@ -58,6 +58,7 @@
"files": [
"dist",
"schemas/**/*.xsd",
+ "schemas/**/*.json",
"assets/fonts",
"LICENSE",
"NOTICE"
diff --git a/schemas/adn/v1/adn-contribuinte-v1.json b/schemas/adn/v1/adn-contribuinte-v1.json
new file mode 100644
index 0000000..c481b74
--- /dev/null
+++ b/schemas/adn/v1/adn-contribuinte-v1.json
@@ -0,0 +1,399 @@
+{
+ "openapi": "3.0.1",
+ "info": {
+ "title": "API NFS-e - ADN Contribuinte",
+ "description": "# Apresentação\n Bem-vindo a documentação técnica da API do Projeto Nota Fiscal de Serviços Eletrônica (NFS-e) que trata a distribuição de documentos fiscais para os contribuintes.\n Aqui você encontrará informações detalhadas sobre os endpoints, parâmetros, respostas e exemplos de uso.\n\n # Padrões técnicos\n A API NFS-e utiliza a arquitetura RESTful que segue os seguintes padrões técnicos:\n\t \n- **Protocolo de comunicação** : TLS 1.2 ou superior com autenticação mútua\n\n- **Formato para troca de mensagens** : JSON\n\n- **Formato dos documentos** : XML 1.0 (https://www.w3.org/TR/REC-xml)\n\n- **Codificação de caracteres** : UTF-8\n\n- **Certificado digital** : Emitido por Autoridade Certificadora ICP-Brasil, tipo A1 ou A3, CNPJ , com \"Autenticação do Cliente\"\n\n- **Padrão de assinatura dos documentos XML** : XMLDSIG (https://www.w3.org/TR/xmldsig-core/)\n\n- **Padrão de compactação dos documentos XML para troca de mensagens** : GZip com representao base64binary",
+ "version": "v1",
+ "x-logo": {
+ "url": "/contribuintes/images/logo_nfse_vertical.png",
+ "altText": "Logo da API",
+ "backgroundColor": "#FFFFFF"
+ }
+ },
+ "paths": {
+ "/DFe/{NSU}": {
+ "get": {
+ "tags": [
+ "DistribuicaoContribuinte"
+ ],
+ "summary": "Retorna o Documento Fiscal de Serviço correspondenente ao NSU informado",
+ "parameters": [
+ {
+ "name": "NSU",
+ "in": "path",
+ "required": true,
+ "schema": {
+ "type": "integer",
+ "format": "int64"
+ }
+ },
+ {
+ "name": "cnpjConsulta",
+ "in": "query",
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "lote",
+ "in": "query",
+ "schema": {
+ "type": "boolean",
+ "default": true
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Success",
+ "content": {
+ "text/plain": {
+ "schema": {
+ "$ref": "#/components/schemas/LoteDistribuicaoNSUResponse"
+ }
+ },
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/LoteDistribuicaoNSUResponse"
+ }
+ },
+ "text/json": {
+ "schema": {
+ "$ref": "#/components/schemas/LoteDistribuicaoNSUResponse"
+ }
+ },
+ "application/xml": {
+ "schema": {
+ "$ref": "#/components/schemas/LoteDistribuicaoNSUResponse"
+ }
+ },
+ "text/xml": {
+ "schema": {
+ "$ref": "#/components/schemas/LoteDistribuicaoNSUResponse"
+ }
+ }
+ }
+ },
+ "400": {
+ "description": "Bad Request",
+ "content": {
+ "text/plain": {
+ "schema": {
+ "$ref": "#/components/schemas/LoteDistribuicaoNSUResponse"
+ }
+ },
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/LoteDistribuicaoNSUResponse"
+ }
+ },
+ "text/json": {
+ "schema": {
+ "$ref": "#/components/schemas/LoteDistribuicaoNSUResponse"
+ }
+ },
+ "application/xml": {
+ "schema": {
+ "$ref": "#/components/schemas/LoteDistribuicaoNSUResponse"
+ }
+ },
+ "text/xml": {
+ "schema": {
+ "$ref": "#/components/schemas/LoteDistribuicaoNSUResponse"
+ }
+ }
+ }
+ },
+ "404": {
+ "description": "Not Found",
+ "content": {
+ "text/plain": {
+ "schema": {
+ "$ref": "#/components/schemas/LoteDistribuicaoNSUResponse"
+ }
+ },
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/LoteDistribuicaoNSUResponse"
+ }
+ },
+ "text/json": {
+ "schema": {
+ "$ref": "#/components/schemas/LoteDistribuicaoNSUResponse"
+ }
+ },
+ "application/xml": {
+ "schema": {
+ "$ref": "#/components/schemas/LoteDistribuicaoNSUResponse"
+ }
+ },
+ "text/xml": {
+ "schema": {
+ "$ref": "#/components/schemas/LoteDistribuicaoNSUResponse"
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "/NFSe/{ChaveAcesso}/Eventos": {
+ "get": {
+ "tags": [
+ "DistribuicaoContribuinte"
+ ],
+ "summary": "Retorna os Documentos Fiscais de Serviço do tipo Evento vinculados à chave de acesso informada",
+ "parameters": [
+ {
+ "name": "ChaveAcesso",
+ "in": "path",
+ "required": true,
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Success",
+ "content": {
+ "text/plain": {
+ "schema": {
+ "$ref": "#/components/schemas/LoteDistribuicaoNSUResponse"
+ }
+ },
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/LoteDistribuicaoNSUResponse"
+ }
+ },
+ "text/json": {
+ "schema": {
+ "$ref": "#/components/schemas/LoteDistribuicaoNSUResponse"
+ }
+ },
+ "application/xml": {
+ "schema": {
+ "$ref": "#/components/schemas/LoteDistribuicaoNSUResponse"
+ }
+ },
+ "text/xml": {
+ "schema": {
+ "$ref": "#/components/schemas/LoteDistribuicaoNSUResponse"
+ }
+ }
+ }
+ },
+ "404": {
+ "description": "Not Found",
+ "content": {
+ "text/plain": {
+ "schema": {
+ "$ref": "#/components/schemas/LoteDistribuicaoNSUResponse"
+ }
+ },
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/LoteDistribuicaoNSUResponse"
+ }
+ },
+ "text/json": {
+ "schema": {
+ "$ref": "#/components/schemas/LoteDistribuicaoNSUResponse"
+ }
+ },
+ "application/xml": {
+ "schema": {
+ "$ref": "#/components/schemas/LoteDistribuicaoNSUResponse"
+ }
+ },
+ "text/xml": {
+ "schema": {
+ "$ref": "#/components/schemas/LoteDistribuicaoNSUResponse"
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "components": {
+ "schemas": {
+ "StatusProcessamentoDistribuicao": {
+ "enum": [
+ "REJEICAO",
+ "NENHUM_DOCUMENTO_LOCALIZADO",
+ "DOCUMENTOS_LOCALIZADOS"
+ ],
+ "type": "string"
+ },
+ "TipoDocumentoRequisicao": {
+ "enum": [
+ "NENHUM",
+ "DPS",
+ "PEDIDO_REGISTRO_EVENTO",
+ "NFSE",
+ "EVENTO",
+ "CNC"
+ ],
+ "type": "string"
+ },
+ "TipoEvento": {
+ "enum": [
+ "CANCELAMENTO",
+ "SOLICITACAO_CANCELAMENTO_ANALISE_FISCAL",
+ "CANCELAMENTO_POR_SUBSTITUICAO",
+ "CANCELAMENTO_DEFERIDO_ANALISE_FISCAL",
+ "CANCELAMENTO_INDEFERIDO_ANALISE_FISCAL",
+ "CONFIRMACAO_PRESTADOR",
+ "REJEICAO_PRESTADOR",
+ "CONFIRMACAO_TOMADOR",
+ "REJEICAO_TOMADOR",
+ "CONFIRMACAO_INTERMEDIARIO",
+ "REJEICAO_INTERMEDIARIO",
+ "CONFIRMACAO_TACITA",
+ "ANULACAO_REJEICAO",
+ "CANCELAMENTO_POR_OFICIO",
+ "BLOQUEIO_POR_OFICIO",
+ "DESBLOQUEIO_POR_OFICIO",
+ "INCLUSAO_NFSE_DAN",
+ "TRIBUTOS_NFSE_RECOLHIDOS"
+ ],
+ "type": "string"
+ },
+ "DistribuicaoNSU": {
+ "type": "object",
+ "properties": {
+ "NSU": {
+ "type": "integer",
+ "format": "int64",
+ "nullable": true
+ },
+ "ChaveAcesso": {
+ "type": "string",
+ "nullable": true
+ },
+ "TipoDocumento": {
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/TipoDocumentoRequisicao"
+ }
+ ]
+ },
+ "TipoEvento": {
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/TipoEvento"
+ }
+ ],
+ "nullable": true
+ },
+ "ArquivoXml": {
+ "type": "string",
+ "nullable": true
+ },
+ "DataHoraGeracao": {
+ "type": "string",
+ "format": "date-time",
+ "nullable": true
+ }
+ },
+ "additionalProperties": false
+ },
+ "Enum": {
+ "type": "object",
+ "additionalProperties": false
+ },
+ "MensagemProcessamento": {
+ "type": "object",
+ "properties": {
+ "Mensagem": {
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/Enum"
+ }
+ ],
+ "nullable": true
+ },
+ "Parametros": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "nullable": true
+ },
+ "Codigo": {
+ "type": "string",
+ "nullable": true
+ },
+ "Descricao": {
+ "type": "string",
+ "nullable": true
+ },
+ "Complemento": {
+ "type": "string",
+ "nullable": true
+ }
+ },
+ "additionalProperties": false
+ },
+ "TipoAmbiente": {
+ "enum": [
+ "PRODUCAO",
+ "HOMOLOGACAO"
+ ],
+ "type": "string"
+ },
+ "LoteDistribuicaoNSUResponse": {
+ "type": "object",
+ "properties": {
+ "StatusProcessamento": {
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/StatusProcessamentoDistribuicao"
+ }
+ ]
+ },
+ "LoteDFe": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/DistribuicaoNSU"
+ },
+ "nullable": true
+ },
+ "Alertas": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/MensagemProcessamento"
+ },
+ "nullable": true
+ },
+ "Erros": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/MensagemProcessamento"
+ },
+ "nullable": true
+ },
+ "TipoAmbiente": {
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/TipoAmbiente"
+ }
+ ]
+ },
+ "VersaoAplicativo": {
+ "type": "string",
+ "nullable": true
+ },
+ "DataHoraProcessamento": {
+ "type": "string",
+ "format": "date-time"
+ }
+ },
+ "additionalProperties": false
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/schemas/adn/v1/adn-municipio-v1.json b/schemas/adn/v1/adn-municipio-v1.json
new file mode 100644
index 0000000..842040b
--- /dev/null
+++ b/schemas/adn/v1/adn-municipio-v1.json
@@ -0,0 +1,424 @@
+{
+ "openapi": "3.0.1",
+ "info": {
+ "title": "API NFS-e - ADN Município",
+ "description": "# Apresentação\n Bem-vindo a documentação técnica da API do Projeto Nota Fiscal de Serviços Eletrônica (NFS-e) que trata a distribuição de documentos fiscais para os municípios.\n Aqui você encontrará informações detalhadas sobre os endpoints, parâmetros, respostas e exemplos de uso.\n\n # Padrões técnicos\n A API NFS-e utiliza a arquitetura RESTful que segue os seguintes padrões técnicos:\n\t \n- **Protocolo de comunicação** : TLS 1.2 ou superior com autenticação mútua\n\n- **Formato para troca de mensagens** : JSON\n\n- **Formato dos documentos** : XML 1.0 (https://www.w3.org/TR/REC-xml)\n\n- **Codificação de caracteres** : UTF-8\n\n- **Certificado digital** : Emitido por Autoridade Certificadora ICP-Brasil, tipo A1 ou A3, CNPJ , com \"Autenticação do Cliente\"\n\n- **Padrão de assinatura dos documentos XML** : XMLDSIG (https://www.w3.org/TR/xmldsig-core/)\n\n- **Padrão de compactação dos documentos XML para troca de mensagens** : GZip com representao base64binary",
+ "version": "v1",
+ "x-logo": {
+ "url": "/municipios/images/logo_nfse_vertical.png",
+ "altText": "Logo da API",
+ "backgroundColor": "#FFFFFF"
+ }
+ },
+ "servers": [
+ {
+ "url": "/municipios"
+ }
+ ],
+ "paths": {
+ "/DFe/{NSU}": {
+ "get": {
+ "tags": [
+ "DistribuicaoMunicipio"
+ ],
+ "summary": "Retorna um lote contendo até 50 Documentos Fiscais de Serviço a partir do NSU informado (inclusive)",
+ "parameters": [
+ {
+ "name": "NSU",
+ "in": "path",
+ "required": true,
+ "schema": {
+ "type": "integer",
+ "format": "int64"
+ }
+ },
+ {
+ "name": "tipoNSU",
+ "in": "query",
+ "schema": {
+ "$ref": "#/components/schemas/TipoNSU"
+ }
+ },
+ {
+ "name": "lote",
+ "in": "query",
+ "schema": {
+ "type": "boolean",
+ "default": true
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Success",
+ "content": {
+ "text/plain": {
+ "schema": {
+ "$ref": "#/components/schemas/LoteDistribuicaoNSUResponse"
+ }
+ },
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/LoteDistribuicaoNSUResponse"
+ }
+ },
+ "text/json": {
+ "schema": {
+ "$ref": "#/components/schemas/LoteDistribuicaoNSUResponse"
+ }
+ },
+ "application/xml": {
+ "schema": {
+ "$ref": "#/components/schemas/LoteDistribuicaoNSUResponse"
+ }
+ },
+ "text/xml": {
+ "schema": {
+ "$ref": "#/components/schemas/LoteDistribuicaoNSUResponse"
+ }
+ }
+ }
+ },
+ "400": {
+ "description": "Bad Request",
+ "content": {
+ "text/plain": {
+ "schema": {
+ "$ref": "#/components/schemas/LoteDistribuicaoNSUResponse"
+ }
+ },
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/LoteDistribuicaoNSUResponse"
+ }
+ },
+ "text/json": {
+ "schema": {
+ "$ref": "#/components/schemas/LoteDistribuicaoNSUResponse"
+ }
+ },
+ "application/xml": {
+ "schema": {
+ "$ref": "#/components/schemas/LoteDistribuicaoNSUResponse"
+ }
+ },
+ "text/xml": {
+ "schema": {
+ "$ref": "#/components/schemas/LoteDistribuicaoNSUResponse"
+ }
+ }
+ }
+ },
+ "404": {
+ "description": "Not Found",
+ "content": {
+ "text/plain": {
+ "schema": {
+ "$ref": "#/components/schemas/LoteDistribuicaoNSUResponse"
+ }
+ },
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/LoteDistribuicaoNSUResponse"
+ }
+ },
+ "text/json": {
+ "schema": {
+ "$ref": "#/components/schemas/LoteDistribuicaoNSUResponse"
+ }
+ },
+ "application/xml": {
+ "schema": {
+ "$ref": "#/components/schemas/LoteDistribuicaoNSUResponse"
+ }
+ },
+ "text/xml": {
+ "schema": {
+ "$ref": "#/components/schemas/LoteDistribuicaoNSUResponse"
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "/NFSe/{ChaveAcesso}/Eventos": {
+ "get": {
+ "tags": [
+ "DistribuicaoMunicipio"
+ ],
+ "summary": "Retorna os Documentos Fiscais de Serviço do tipo Evento vinculados à chave de acesso informada",
+ "parameters": [
+ {
+ "name": "ChaveAcesso",
+ "in": "path",
+ "required": true,
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Success",
+ "content": {
+ "text/plain": {
+ "schema": {
+ "$ref": "#/components/schemas/LoteDistribuicaoNSUResponse"
+ }
+ },
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/LoteDistribuicaoNSUResponse"
+ }
+ },
+ "text/json": {
+ "schema": {
+ "$ref": "#/components/schemas/LoteDistribuicaoNSUResponse"
+ }
+ },
+ "application/xml": {
+ "schema": {
+ "$ref": "#/components/schemas/LoteDistribuicaoNSUResponse"
+ }
+ },
+ "text/xml": {
+ "schema": {
+ "$ref": "#/components/schemas/LoteDistribuicaoNSUResponse"
+ }
+ }
+ }
+ },
+ "400": {
+ "description": "Bad Request",
+ "content": {
+ "text/plain": {
+ "schema": {
+ "$ref": "#/components/schemas/LoteDistribuicaoNSUResponse"
+ }
+ },
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/LoteDistribuicaoNSUResponse"
+ }
+ },
+ "text/json": {
+ "schema": {
+ "$ref": "#/components/schemas/LoteDistribuicaoNSUResponse"
+ }
+ },
+ "application/xml": {
+ "schema": {
+ "$ref": "#/components/schemas/LoteDistribuicaoNSUResponse"
+ }
+ },
+ "text/xml": {
+ "schema": {
+ "$ref": "#/components/schemas/LoteDistribuicaoNSUResponse"
+ }
+ }
+ }
+ },
+ "404": {
+ "description": "Not Found",
+ "content": {
+ "text/plain": {
+ "schema": {
+ "$ref": "#/components/schemas/LoteDistribuicaoNSUResponse"
+ }
+ },
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/LoteDistribuicaoNSUResponse"
+ }
+ },
+ "text/json": {
+ "schema": {
+ "$ref": "#/components/schemas/LoteDistribuicaoNSUResponse"
+ }
+ },
+ "application/xml": {
+ "schema": {
+ "$ref": "#/components/schemas/LoteDistribuicaoNSUResponse"
+ }
+ },
+ "text/xml": {
+ "schema": {
+ "$ref": "#/components/schemas/LoteDistribuicaoNSUResponse"
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "components": {
+ "schemas": {
+ "TipoNSU": {
+ "enum": [
+ "RECEPCAO",
+ "DISTRIBUICAO",
+ "GERAL",
+ "MEI"
+ ],
+ "type": "string"
+ },
+ "StatusProcessamentoDistribuicao": {
+ "enum": [
+ "REJEICAO",
+ "NENHUM_DOCUMENTO_LOCALIZADO",
+ "DOCUMENTOS_LOCALIZADOS"
+ ],
+ "type": "string"
+ },
+ "TipoDocumentoRequisicao": {
+ "enum": [
+ "NENHUM",
+ "DPS",
+ "PEDIDO_REGISTRO_EVENTO",
+ "NFSE",
+ "EVENTO",
+ "CNC"
+ ],
+ "type": "string"
+ },
+ "TipoEvento": {
+ "enum": [
+ "CANCELAMENTO",
+ "SOLICITACAO_CANCELAMENTO_ANALISE_FISCAL",
+ "CANCELAMENTO_POR_SUBSTITUICAO",
+ "CANCELAMENTO_DEFERIDO_ANALISE_FISCAL",
+ "CANCELAMENTO_INDEFERIDO_ANALISE_FISCAL",
+ "CONFIRMACAO_PRESTADOR",
+ "REJEICAO_PRESTADOR",
+ "CONFIRMACAO_TOMADOR",
+ "REJEICAO_TOMADOR",
+ "CONFIRMACAO_INTERMEDIARIO",
+ "REJEICAO_INTERMEDIARIO",
+ "CONFIRMACAO_TACITA",
+ "ANULACAO_REJEICAO",
+ "CANCELAMENTO_POR_OFICIO",
+ "BLOQUEIO_POR_OFICIO",
+ "DESBLOQUEIO_POR_OFICIO",
+ "TRIBUTOS_NFSE_RECOLHIDOS",
+ "INCLUSAO_NFSE_DAN"
+ ],
+ "type": "string"
+ },
+ "DistribuicaoNSU": {
+ "type": "object",
+ "properties": {
+ "NSU": {
+ "type": "integer",
+ "format": "int64",
+ "nullable": true
+ },
+ "ChaveAcesso": {
+ "type": "string",
+ "nullable": true
+ },
+ "TipoDocumento": {
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/TipoDocumentoRequisicao"
+ }
+ ]
+ },
+ "TipoEvento": {
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/TipoEvento"
+ }
+ ],
+ "nullable": true
+ },
+ "ArquivoXml": {
+ "type": "string",
+ "nullable": true
+ },
+ "DataHoraGeracao": {
+ "type": "string",
+ "format": "date-time",
+ "nullable": true
+ }
+ },
+ "additionalProperties": false
+ },
+ "MensagemProcessamento": {
+ "type": "object",
+ "properties": {
+ "Codigo": {
+ "type": "string",
+ "nullable": true
+ },
+ "Descricao": {
+ "type": "string",
+ "nullable": true
+ },
+ "Complemento": {
+ "type": "string",
+ "nullable": true
+ }
+ },
+ "additionalProperties": false
+ },
+ "TipoAmbiente": {
+ "enum": [
+ "PRODUCAO",
+ "HOMOLOGACAO"
+ ],
+ "type": "string"
+ },
+ "LoteDistribuicaoNSUResponse": {
+ "type": "object",
+ "properties": {
+ "StatusProcessamento": {
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/StatusProcessamentoDistribuicao"
+ }
+ ]
+ },
+ "LoteDFe": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/DistribuicaoNSU"
+ },
+ "nullable": true
+ },
+ "Alertas": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/MensagemProcessamento"
+ },
+ "nullable": true
+ },
+ "Erros": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/MensagemProcessamento"
+ },
+ "nullable": true
+ },
+ "TipoAmbiente": {
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/TipoAmbiente"
+ }
+ ]
+ },
+ "VersaoAplicativo": {
+ "type": "string",
+ "nullable": true
+ },
+ "DataHoraProcessamento": {
+ "type": "string",
+ "format": "date-time"
+ }
+ },
+ "additionalProperties": false
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/schemas/adn/v1/adn-parametros-municipais-v1.json b/schemas/adn/v1/adn-parametros-municipais-v1.json
new file mode 100644
index 0000000..ffd6529
--- /dev/null
+++ b/schemas/adn/v1/adn-parametros-municipais-v1.json
@@ -0,0 +1,1079 @@
+{
+ "openapi": "3.0.1",
+ "info": {
+ "title": "API NFS-e - ADN Parâmetros Municipais",
+ "description": "# Apresentação\n Bem-vindo a documentação técnica da API do Projeto Nota Fiscal de Serviços Eletrônica (NFS-e) que trata a parametrização de municípios.\n Aqui você encontrará informações detalhadas sobre os endpoints, parâmetros, respostas e exemplos de uso.",
+ "version": "v1",
+ "x-logo": {
+ "url": "/parametrizacao/images/logo_nfse_vertical.png",
+ "altText": "Logo da API",
+ "backgroundColor": "#FFFFFF"
+ }
+ },
+ "servers": [
+ {
+ "url": "/parametrizacao"
+ }
+ ],
+ "paths": {
+ "/{codigoMunicipio}/{codigoServico}/{competencia}/aliquota": {
+ "get": {
+ "tags": [
+ "Aliquotas"
+ ],
+ "summary": "Consulta alíquotas",
+ "description": "Retorna uma alíquota do ISSQN parametrizada de um município a partir desta consulta.",
+ "parameters": [
+ {
+ "name": "codigoMunicipio",
+ "in": "path",
+ "description": "Código do município",
+ "required": true,
+ "schema": {
+ "type": "integer",
+ "format": "int32"
+ }
+ },
+ {
+ "name": "codigoServico",
+ "in": "path",
+ "description": "Código do serviço",
+ "required": true,
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "competencia",
+ "in": "path",
+ "description": "Data de competência",
+ "required": true,
+ "schema": {
+ "type": "string",
+ "format": "date-time"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Success",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ResultadoConsultaAliquotas"
+ }
+ }
+ }
+ },
+ "400": {
+ "description": "Bad Request",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ResultadoConsultaAliquotas"
+ }
+ }
+ }
+ },
+ "404": {
+ "description": "Not Found",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ResultadoConsultaAliquotas"
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "/{codigoMunicipio}/{codigoServico}/historicoaliquotas": {
+ "get": {
+ "tags": [
+ "Aliquotas"
+ ],
+ "summary": "Consulta histórico de alíquotas",
+ "description": "Retorna histórico de alíquotas do ISSQN parametrizadas de um município a partir de um código de município e código de serviço.",
+ "parameters": [
+ {
+ "name": "codigoMunicipio",
+ "in": "path",
+ "description": "Código do município",
+ "required": true,
+ "schema": {
+ "type": "integer",
+ "format": "int32"
+ }
+ },
+ {
+ "name": "codigoServico",
+ "in": "path",
+ "description": "Código do serviço",
+ "required": true,
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Success",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ResultadoConsultaAliquotas"
+ }
+ }
+ }
+ },
+ "400": {
+ "description": "Bad Request",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ResultadoConsultaAliquotas"
+ }
+ }
+ }
+ },
+ "404": {
+ "description": "Not Found",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ResultadoConsultaAliquotas"
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "/{codigoMunicipio}/{numeroBeneficio}/{competencia}/beneficio": {
+ "get": {
+ "tags": [
+ "Beneficio"
+ ],
+ "summary": "Consulta benefício municipal",
+ "description": "Retorna os parâmetros de um número de benefício municipal a partir desta consulta.",
+ "parameters": [
+ {
+ "name": "codigoMunicipio",
+ "in": "path",
+ "description": "Código do município",
+ "required": true,
+ "schema": {
+ "type": "integer",
+ "format": "int32"
+ }
+ },
+ {
+ "name": "numeroBeneficio",
+ "in": "path",
+ "description": "Número do benefício municipal",
+ "required": true,
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "competencia",
+ "in": "path",
+ "description": "Data de competência",
+ "required": true,
+ "schema": {
+ "type": "string",
+ "format": "date-time"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Success",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ResultadoConsultaBeneficio"
+ }
+ }
+ }
+ },
+ "400": {
+ "description": "Bad Request",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ResultadoConsultaBeneficio"
+ }
+ }
+ }
+ },
+ "404": {
+ "description": "Not Found",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ResultadoConsultaBeneficio"
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "/{codigoMunicipio}/beneficiomunicipal/{idManut}": {
+ "post": {
+ "tags": [
+ "Beneficio"
+ ],
+ "summary": "Alteração de parâmetros de benefícios municipais",
+ "description": "Recepciona um arquivo PARAM para a manutenção de beneficiários dos beneficios municipais",
+ "parameters": [
+ {
+ "name": "codigoMunicipio",
+ "in": "path",
+ "required": true,
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "idManut",
+ "in": "path",
+ "required": true,
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "requestBody": {
+ "description": "Estrutura contendo um arquivo PARAM compactado no padrão gZip (base64Binary)",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ParamPostRequest"
+ }
+ },
+ "text/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ParamPostRequest"
+ }
+ },
+ "application/*+json": {
+ "schema": {
+ "$ref": "#/components/schemas/ParamPostRequest"
+ }
+ }
+ }
+ },
+ "responses": {
+ "200": {
+ "description": "Success"
+ }
+ }
+ }
+ },
+ "/{codigoMunicipio}/convenio": {
+ "get": {
+ "tags": [
+ "Convenio"
+ ],
+ "summary": "Consulta convênios municipais",
+ "description": "Retorna os parâmetros do convênio de um município a partir desta consulta.",
+ "parameters": [
+ {
+ "name": "codigoMunicipio",
+ "in": "path",
+ "description": "Código do município",
+ "required": true,
+ "schema": {
+ "type": "integer",
+ "format": "int32"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Success",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ResultadoConsultaConfiguracoesConvenio"
+ }
+ }
+ }
+ },
+ "400": {
+ "description": "Bad Request",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ResultadoConsultaConfiguracoesConvenio"
+ }
+ }
+ }
+ },
+ "404": {
+ "description": "Not Found",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ResultadoConsultaConfiguracoesConvenio"
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "/{codigoMunicipio}/{codigoServico}/{competencia}/regimes_especiais": {
+ "get": {
+ "tags": [
+ "RegimesEspeciais"
+ ],
+ "summary": "Consulta regimes especiais",
+ "description": "Retorna os parâmetros de regimes especiais de tributação de um município a partir desta consulta.",
+ "parameters": [
+ {
+ "name": "codigoMunicipio",
+ "in": "path",
+ "description": "Código do município",
+ "required": true,
+ "schema": {
+ "type": "integer",
+ "format": "int32"
+ }
+ },
+ {
+ "name": "codigoServico",
+ "in": "path",
+ "description": "Código do serviço",
+ "required": true,
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "competencia",
+ "in": "path",
+ "description": "Data de competência",
+ "required": true,
+ "schema": {
+ "type": "string",
+ "format": "date-time"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Success",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ResultadoConsultaRegimesEspeciais"
+ }
+ }
+ }
+ },
+ "400": {
+ "description": "Bad Request",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ResultadoConsultaRegimesEspeciais"
+ }
+ }
+ }
+ },
+ "404": {
+ "description": "Not Found",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ResultadoConsultaRegimesEspeciais"
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "/{codigoMunicipio}/regimes_especiais/{idManut}": {
+ "post": {
+ "tags": [
+ "RegimesEspeciais"
+ ],
+ "summary": "Alteração parâmetros regimes especiais",
+ "description": "Recepciona um arquivo PARAM para a manutenção de beneficiários de regimes especiais",
+ "parameters": [
+ {
+ "name": "codigoMunicipio",
+ "in": "path",
+ "required": true,
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "idManut",
+ "in": "path",
+ "required": true,
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "requestBody": {
+ "description": "Estrutura contendo um arquivo PARAM compactado no padrão gZip (base64Binary)",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ParamPostRequest"
+ }
+ },
+ "text/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ParamPostRequest"
+ }
+ },
+ "application/*+json": {
+ "schema": {
+ "$ref": "#/components/schemas/ParamPostRequest"
+ }
+ }
+ }
+ },
+ "responses": {
+ "200": {
+ "description": "Success"
+ }
+ }
+ }
+ },
+ "/{codigoMunicipio}/{competencia}/retencoes": {
+ "get": {
+ "tags": [
+ "Retencoes"
+ ],
+ "summary": "Consulta retenções município",
+ "description": "Retorna os parâmetros para retenções do ISSQN de um município a partir desta consulta.",
+ "parameters": [
+ {
+ "name": "codigoMunicipio",
+ "in": "path",
+ "description": "Código do município",
+ "required": true,
+ "schema": {
+ "type": "integer",
+ "format": "int32"
+ }
+ },
+ {
+ "name": "competencia",
+ "in": "path",
+ "description": "Data de competencia",
+ "required": true,
+ "schema": {
+ "type": "string",
+ "format": "date-time"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Success",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ResultadoConsultaRetencoes"
+ }
+ }
+ }
+ },
+ "400": {
+ "description": "Bad Request",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ResultadoConsultaRetencoes"
+ }
+ }
+ }
+ },
+ "404": {
+ "description": "Not Found",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ResultadoConsultaRetencoes"
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "/{codigoMunicipio}/retencoes/{idManut}": {
+ "post": {
+ "tags": [
+ "Retencoes"
+ ],
+ "summary": "Alteração de parametros de retenções municipais",
+ "description": "Recepciona um arquivo PARAM para a manutenção de beneficiários das retenções municipais",
+ "parameters": [
+ {
+ "name": "codigoMunicipio",
+ "in": "path",
+ "required": true,
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "idManut",
+ "in": "path",
+ "required": true,
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "requestBody": {
+ "description": "Estrutura contendo um arquivo PARAM compactado no padrão gZip (base64Binary)",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ParamPostRequest"
+ }
+ },
+ "text/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ParamPostRequest"
+ }
+ },
+ "application/*+json": {
+ "schema": {
+ "$ref": "#/components/schemas/ParamPostRequest"
+ }
+ }
+ }
+ },
+ "responses": {
+ "200": {
+ "description": "Success"
+ }
+ }
+ }
+ }
+ },
+ "components": {
+ "schemas": {
+ "Aliquota": {
+ "type": "object",
+ "properties": {
+ "Incidencia": {
+ "type": "string",
+ "nullable": true
+ },
+ "Aliq": {
+ "type": "number",
+ "format": "double",
+ "nullable": true
+ },
+ "DtIni": {
+ "type": "string",
+ "format": "date-time"
+ },
+ "DtFim": {
+ "type": "string",
+ "format": "date-time",
+ "nullable": true
+ }
+ },
+ "additionalProperties": false
+ },
+ "Beneficio": {
+ "type": "object",
+ "properties": {
+ "codigoBeneficio": {
+ "type": "string",
+ "nullable": true
+ },
+ "descricao": {
+ "type": "string",
+ "description": "",
+ "nullable": true
+ },
+ "dataInicioVigencia": {
+ "type": "string",
+ "description": "",
+ "format": "date-time"
+ },
+ "dataFimVigencia": {
+ "type": "string",
+ "description": "",
+ "format": "date-time",
+ "nullable": true
+ },
+ "tipoBeneficio": {
+ "$ref": "#/components/schemas/TipoBeneficioMunicipal"
+ },
+ "tipoReducaoBC": {
+ "$ref": "#/components/schemas/TipoReducaoBaseDeCalculo"
+ },
+ "reducaoPercentualBC": {
+ "type": "number",
+ "description": "",
+ "format": "double",
+ "nullable": true
+ },
+ "aliquotaDiferenciada": {
+ "type": "number",
+ "description": "",
+ "format": "double",
+ "nullable": true
+ },
+ "restritoAoMunicipio": {
+ "type": "boolean",
+ "description": "",
+ "nullable": true
+ },
+ "servicos": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/BeneficioServico"
+ },
+ "description": "",
+ "nullable": true
+ },
+ "contribuintes": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/BeneficioInscricao"
+ },
+ "description": "",
+ "nullable": true
+ }
+ },
+ "additionalProperties": false,
+ "description": ""
+ },
+ "BeneficioInscricao": {
+ "type": "object",
+ "properties": {
+ "tipoInscricao": {
+ "$ref": "#/components/schemas/TipoInscricao"
+ },
+ "inscricao": {
+ "type": "string",
+ "nullable": true
+ },
+ "dataInicioVigencia": {
+ "type": "string",
+ "description": "",
+ "format": "date-time"
+ },
+ "dataFimVigencia": {
+ "type": "string",
+ "description": "",
+ "format": "date-time",
+ "nullable": true
+ }
+ },
+ "additionalProperties": false
+ },
+ "BeneficioServico": {
+ "type": "object",
+ "properties": {
+ "codigoServico": {
+ "type": "string",
+ "description": "",
+ "nullable": true
+ },
+ "dataInicioVigencia": {
+ "type": "string",
+ "description": "",
+ "format": "date-time"
+ },
+ "dataFimVigencia": {
+ "type": "string",
+ "description": "",
+ "format": "date-time",
+ "nullable": true
+ }
+ },
+ "additionalProperties": false
+ },
+ "ParamPostRequest": {
+ "type": "object",
+ "properties": {
+ "tipoAmbiente": {
+ "$ref": "#/components/schemas/TipoAmbiente"
+ },
+ "paramXmlGZipB64": {
+ "type": "string",
+ "description": "PARAM compactado no padrão gZip (base64Binary)",
+ "nullable": true
+ }
+ },
+ "additionalProperties": false
+ },
+ "ParametrosConfiguracaoConvenio": {
+ "type": "object",
+ "properties": {
+ "tipoConvenioDeserializationSetter": {
+ "$ref": "#/components/schemas/TipoConvenio"
+ },
+ "aderenteAmbienteNacional": {
+ "$ref": "#/components/schemas/TipoSimNao"
+ },
+ "aderenteEmissorNacional": {
+ "$ref": "#/components/schemas/TipoSimNao"
+ },
+ "situacaoEmissaoPadraoContribuintesRFB": {
+ "$ref": "#/components/schemas/TipoSituacaoEmissaoPadraoContribuintesRFB"
+ },
+ "aderenteMAN": {
+ "$ref": "#/components/schemas/TipoSimNao"
+ },
+ "permiteAproveitametoDeCreditos": {
+ "type": "boolean",
+ "nullable": true
+ }
+ },
+ "additionalProperties": false,
+ "description": ""
+ },
+ "RegimeEspecial": {
+ "type": "object",
+ "properties": {
+ "situacao": {
+ "$ref": "#/components/schemas/TipoConfiguracaoRegimeEspecial"
+ },
+ "dataInicio": {
+ "type": "string",
+ "description": "",
+ "format": "date-time"
+ },
+ "dataFim": {
+ "type": "string",
+ "description": "",
+ "format": "date-time",
+ "nullable": true
+ },
+ "observacoes": {
+ "type": "string",
+ "description": "",
+ "nullable": true
+ }
+ },
+ "additionalProperties": false,
+ "description": ""
+ },
+ "ResultadoConsultaAliquotas": {
+ "type": "object",
+ "properties": {
+ "mensagem": {
+ "type": "string",
+ "nullable": true
+ },
+ "aliquotas": {
+ "type": "object",
+ "additionalProperties": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/Aliquota"
+ }
+ },
+ "description": "Alíquotas",
+ "nullable": true
+ }
+ },
+ "additionalProperties": false,
+ "description": "Resultado da consulta de alíquotas"
+ },
+ "ResultadoConsultaBeneficio": {
+ "type": "object",
+ "properties": {
+ "mensagem": {
+ "type": "string",
+ "nullable": true
+ },
+ "beneficio": {
+ "$ref": "#/components/schemas/Beneficio"
+ }
+ },
+ "additionalProperties": false,
+ "description": "Resultado da consulta dos benefícios municipais"
+ },
+ "ResultadoConsultaConfiguracoesConvenio": {
+ "type": "object",
+ "properties": {
+ "mensagem": {
+ "type": "string",
+ "nullable": true
+ },
+ "parametrosConvenio": {
+ "$ref": "#/components/schemas/ParametrosConfiguracaoConvenio"
+ }
+ },
+ "additionalProperties": false,
+ "description": "Resultado da consulta dos convênios municipais"
+ },
+ "ResultadoConsultaRegimesEspeciais": {
+ "type": "object",
+ "properties": {
+ "mensagem": {
+ "type": "string",
+ "nullable": true
+ },
+ "regimesEspeciais": {
+ "type": "object",
+ "additionalProperties": {
+ "type": "object",
+ "additionalProperties": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/RegimeEspecial"
+ }
+ }
+ },
+ "description": "Regimes especiais",
+ "nullable": true
+ }
+ },
+ "additionalProperties": false,
+ "description": "Resultado da consulta de regimes especiais"
+ },
+ "ResultadoConsultaRetencoes": {
+ "type": "object",
+ "properties": {
+ "mensagem": {
+ "type": "string",
+ "nullable": true
+ },
+ "retencoes": {
+ "$ref": "#/components/schemas/Retencoes"
+ }
+ },
+ "additionalProperties": false,
+ "description": "Resultado da consulta de retenções"
+ },
+ "RetencaoArtigoSexto": {
+ "type": "object",
+ "properties": {
+ "dataInicioVigencia": {
+ "type": "string",
+ "description": "",
+ "format": "date-time"
+ },
+ "dataFimVigencia": {
+ "type": "string",
+ "description": "",
+ "format": "date-time",
+ "nullable": true
+ }
+ },
+ "additionalProperties": false,
+ "description": ""
+ },
+ "RetencaoMunicipal": {
+ "type": "object",
+ "properties": {
+ "descricao": {
+ "type": "string",
+ "description": "",
+ "nullable": true
+ },
+ "dataInicioVigencia": {
+ "type": "string",
+ "description": "",
+ "format": "date-time"
+ },
+ "dataFimVigencia": {
+ "type": "string",
+ "description": "",
+ "format": "date-time",
+ "nullable": true
+ },
+ "tiposRetencao": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/TipoRetencaoISSQN"
+ },
+ "description": "",
+ "nullable": true
+ },
+ "servicos": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/RetencaoMunicipalPorCodigoServico"
+ },
+ "description": "",
+ "nullable": true
+ }
+ },
+ "additionalProperties": false,
+ "description": ""
+ },
+ "RetencaoMunicipalPorCodigoServico": {
+ "type": "object",
+ "properties": {
+ "codigoCompleto": {
+ "type": "string",
+ "description": "",
+ "nullable": true
+ },
+ "historico": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/RetencaoMunicipalServico"
+ },
+ "description": "",
+ "nullable": true
+ }
+ },
+ "additionalProperties": false,
+ "description": ""
+ },
+ "RetencaoMunicipalServico": {
+ "type": "object",
+ "properties": {
+ "dataInicioVigencia": {
+ "type": "string",
+ "description": "",
+ "format": "date-time"
+ },
+ "dataFimVigencia": {
+ "type": "string",
+ "description": "",
+ "format": "date-time",
+ "nullable": true
+ }
+ },
+ "additionalProperties": false,
+ "description": ""
+ },
+ "Retencoes": {
+ "type": "object",
+ "properties": {
+ "artigoSexto": {
+ "$ref": "#/components/schemas/RetencoesArtigoSexto"
+ },
+ "retencoesMunicipais": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/RetencaoMunicipal"
+ },
+ "description": "",
+ "nullable": true
+ }
+ },
+ "additionalProperties": false,
+ "description": ""
+ },
+ "RetencoesArtigoSexto": {
+ "type": "object",
+ "properties": {
+ "habilitado": {
+ "type": "boolean",
+ "description": ""
+ },
+ "historico": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/RetencaoArtigoSexto"
+ },
+ "description": "",
+ "nullable": true
+ }
+ },
+ "additionalProperties": false,
+ "description": ""
+ },
+ "TipoAmbiente": {
+ "enum": [
+ 1,
+ 2
+ ],
+ "type": "integer",
+ "format": "int32"
+ },
+ "TipoBeneficioMunicipal": {
+ "enum": [
+ 1,
+ 2,
+ 3,
+ 4
+ ],
+ "type": "integer",
+ "format": "int32"
+ },
+ "TipoConfiguracaoRegimeEspecial": {
+ "enum": [
+ 1,
+ 2,
+ 3
+ ],
+ "type": "integer",
+ "format": "int32"
+ },
+ "TipoConvenio": {
+ "enum": [
+ 1,
+ 2
+ ],
+ "type": "integer",
+ "format": "int32"
+ },
+ "TipoInscricao": {
+ "enum": [
+ 0,
+ 1,
+ 2,
+ 3,
+ 4
+ ],
+ "type": "integer",
+ "format": "int32"
+ },
+ "TipoReducaoBaseDeCalculo": {
+ "enum": [
+ 1,
+ 2
+ ],
+ "type": "integer",
+ "format": "int32"
+ },
+ "TipoRetencaoISSQN": {
+ "enum": [
+ 0,
+ 1,
+ 2,
+ 3
+ ],
+ "type": "integer",
+ "format": "int32"
+ },
+ "TipoSimNao": {
+ "enum": [
+ 0,
+ 1,
+ -1
+ ],
+ "type": "integer",
+ "format": "int32"
+ },
+ "TipoSituacaoEmissaoPadraoContribuintesRFB": {
+ "enum": [
+ 0,
+ 1,
+ -1
+ ],
+ "type": "integer",
+ "format": "int32"
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/schemas/adn/v1/adn-recepcao-v1.json b/schemas/adn/v1/adn-recepcao-v1.json
new file mode 100644
index 0000000..d2ff502
--- /dev/null
+++ b/schemas/adn/v1/adn-recepcao-v1.json
@@ -0,0 +1,216 @@
+{
+ "openapi": "3.0.1",
+ "info": {
+ "title": "API NFS-e - ADN Recepção",
+ "description": " # Apresentação\n Bem-vindo a documentação técnica da API do Projeto Nota Fiscal de Serviços Eletrônica (NFS-e) que trata a recepção de documentos compartilhados no ambiente nacional (ADN).\n\n Aqui você encontrará informações detalhadas sobre os endpoints, parâmetros, respostas e exemplos de uso.\n",
+ "version": "v1",
+ "x-logo": {
+ "url": "/adn/images/logo_nfse_vertical.png",
+ "altText": "NFS-e",
+ "backgroundColor": "#FFFFFF"
+ }
+ },
+ "servers": [
+ {
+ "url": "/adn"
+ }
+ ],
+ "paths": {
+ "/DFe": {
+ "post": {
+ "tags": [
+ "Recepcao"
+ ],
+ "summary": "Recepciona um lote de Documentos",
+ "requestBody": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/RecepcaoRequest"
+ }
+ }
+ }
+ },
+ "responses": {
+ "201": {
+ "description": "Success",
+ "content": {
+ "text/plain": {
+ "schema": {
+ "$ref": "#/components/schemas/RecepcaoResponseLote"
+ }
+ },
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/RecepcaoResponseLote"
+ }
+ },
+ "text/json": {
+ "schema": {
+ "$ref": "#/components/schemas/RecepcaoResponseLote"
+ }
+ },
+ "application/xml": {
+ "schema": {
+ "$ref": "#/components/schemas/RecepcaoResponseLote"
+ }
+ },
+ "text/xml": {
+ "schema": {
+ "$ref": "#/components/schemas/RecepcaoResponseLote"
+ }
+ }
+ }
+ },
+ "400": {
+ "description": "Bad Request",
+ "content": {
+ "text/plain": {
+ "schema": {
+ "$ref": "#/components/schemas/ProblemDetails"
+ }
+ },
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ProblemDetails"
+ }
+ },
+ "text/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ProblemDetails"
+ }
+ },
+ "application/xml": {
+ "schema": {
+ "$ref": "#/components/schemas/ProblemDetails"
+ }
+ },
+ "text/xml": {
+ "schema": {
+ "$ref": "#/components/schemas/ProblemDetails"
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "components": {
+ "schemas": {
+ "RecepcaoRequest": {
+ "type": "object",
+ "properties": {
+ "LoteXmlGZipB64": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "nullable": true
+ }
+ },
+ "additionalProperties": false
+ },
+ "MensagemProcessamento": {
+ "type": "object",
+ "properties": {
+ "Codigo": {
+ "type": "string",
+ "nullable": true
+ },
+ "Descricao": {
+ "type": "string",
+ "nullable": true
+ },
+ "Complemento": {
+ "type": "string",
+ "nullable": true
+ }
+ },
+ "additionalProperties": false
+ },
+ "RecepcaoResponseDocumento": {
+ "type": "object",
+ "properties": {
+ "ChaveAcesso": {
+ "type": "string",
+ "description": "Chave de acesso",
+ "nullable": true
+ },
+ "NsuRecepcao": {
+ "type": "string",
+ "description": "NSU - Número Sequencial de Busca",
+ "nullable": true
+ },
+ "StatusProcessamento": {
+ "type": "string",
+ "description": "Status do processamento",
+ "nullable": true
+ },
+ "Alertas": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/MensagemProcessamento"
+ },
+ "description": "Alertas da NFS-e",
+ "nullable": true,
+ "readOnly": true
+ },
+ "Erros": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/MensagemProcessamento"
+ },
+ "description": "Erros da NFS-e gerada",
+ "nullable": true,
+ "readOnly": true
+ }
+ },
+ "additionalProperties": false
+ },
+ "TipoAmbiente": {
+ "enum": [
+ "PRODUCAO",
+ "HOMOLOGACAO"
+ ],
+ "type": "string"
+ },
+ "RecepcaoResponseLote": {
+ "type": "object",
+ "properties": {
+ "Lote": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/RecepcaoResponseDocumento"
+ },
+ "description": "Lote de documentos processados",
+ "nullable": true
+ },
+ "TipoAmbiente": {
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/TipoAmbiente"
+ }
+ ]
+ },
+ "VersaoAplicativo": {
+ "type": "string",
+ "nullable": true
+ },
+ "DataHoraProcessamento": {
+ "type": "string",
+ "format": "date-time"
+ }
+ },
+ "additionalProperties": false
+ },
+ "ProblemDetails": {
+ "type": "object",
+ "additionalProperties": {
+ "type": "object",
+ "additionalProperties": false
+ }
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/schemas/adn/v1/cnc-consulta-v1.json b/schemas/adn/v1/cnc-consulta-v1.json
new file mode 100644
index 0000000..5c2196a
--- /dev/null
+++ b/schemas/adn/v1/cnc-consulta-v1.json
@@ -0,0 +1,278 @@
+{
+ "openapi": "3.0.1",
+ "info": {
+ "title": "API NFS-e - CNC Consulta",
+ "description": " # Apresentação\n Bem-vindo a documentação técnica da API do Projeto Nota Fiscal de Serviços Eletrônica (NFS-e) que trata a consulta do Cadastro Nacional de Contribuintes (CNC).\n\n Aqui você encontrará informações detalhadas sobre os endpoints, parâmetros, respostas e exemplos de uso. \n\n # Sobre o CNC\n O CNC é um módulo do Sistema Nacional NFS-e que trata informações de contribuintes emissores de documentos de NFS-e. Para emissão de notas, o Sistema Nacional NFS-e utiliza as bases oficiais da Receita Federal do Brasil (CNPJ/CPF) \n como fonte principal de informações dos contribuintes. O CNC serve como base de informações complementares de uso opcional pelos municípios conveniados ao Sistema.\n\n Através desta API, os municípios conveniados ao Sistema Nacional da NFS-e podem consultar as informações complementares dos contribuintes sob sua gestão, recuperando informações sobre eles em formato JSON (JavaScript Object Notation).\n\n # Requisitos para uso\n Para estabelecer conexão com esta API, é necessário informar um Certificado Digital do tipo e-CNPJ. O Cerfificado Digital deve seguir as especificações detalhadas nos padrões técnicos do projeto e o CNPJ do mesmo deve possuir autorização\n a acessar o endpoint da API. Esta autorização deve ser adquirida junto ao Comitê Gestor da NFS-e.\n\n # Padrões técnicos\n A API NFS-e de Consulta do CNC é uma API RESTful que segue os seguintes padrões técnicos:\n\t \n- **Protocolo de comunicação** : TLS 1.2 ou superior com autenticação mútua\n\n- **Formato para troca de mensagens** : JSON\n\n- **Formato dos documentos do CNC** : XML 1.0 (https://www.w3.org/TR/REC-xml)\n\n- **Codificação de caracteres** : UTF-8\n\n- **Certificado digital** : Emitido por Autoridade Certificadora ICP-Brasil, tipo A1 ou A3, CNPJ , com \"Autenticação do Cliente\"\n\n- **Padrão de assinatura dos documentos XML** : XMLDSIG (https://www.w3.org/TR/xmldsig-core/)\n\n- **Padrão de compactação dos documentos XML para troca de mensagens** : GZip com representao base64binary",
+ "version": "v1",
+ "x-logo": {
+ "url": "/cnc/consulta/images/logo_nfse_vertical.png",
+ "altText": "Logo da API",
+ "backgroundColor": "#FFFFFF"
+ }
+ },
+ "servers": [
+ {
+ "url": "/cnc/consulta"
+ }
+ ],
+ "paths": {
+ "/cad": {
+ "get": {
+ "tags": [
+ "Consulta"
+ ],
+ "summary": "Este endpoint permite a consulta das informações atuais de contribuintes no CNC",
+ "parameters": [
+ {
+ "name": "codMunicipio",
+ "in": "query",
+ "description": "Código IBGE do município do contribuinte.",
+ "schema": {
+ "type": "integer",
+ "format": "int32"
+ }
+ },
+ {
+ "name": "inscricaoFederal",
+ "in": "query",
+ "description": "Inscrição federal do contribuinte, podendo ser CPF ou CNPJ.",
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "indicadorMunicipal",
+ "in": "query",
+ "description": "Indicador Municipal do contribuinte.",
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Success",
+ "content": {
+ "text/plain": {
+ "schema": {
+ "$ref": "#/components/schemas/ExemploRetornoSucessoCadastro"
+ },
+ "example": {"ListaCadastroMunicipal":[{"OrigemDados":"CNC","CodigoMunicipio":1234567,"TipoAmbiente":"HOMOLOGACAO","Id":1,"CodigoUF":12,"InfCad":{"Inscricao":"99999999999999","TpInscricao":"CNPJ","InscricaoMunicipal":"1234567","DataInicioInscricaoMunicipal":"2026-08-13T20:37:46.0657532-03:00","DataApenasInicioInscricaoMunicipal":"2026-08-13","RazaoSocial":"Razao Social","InfoEndereco":{"CEP":"12345678","Logradouro":"Logradouro","Numero":"123","Complemento":"Complemento","Bairro":"Bairro"},"Telefone":"1234567890","Email":"email@email.com","SituacaoEmissaoNFSe":"HABILITADO","SituacaoCadastral":"1","MotivoSituacaoCadastral":"Motivo"},"DhCadastro":"2026-08-13T20:37:46.0657534-03:00","DhAtualizacao":"2026-08-13T20:37:46.0657536-03:00","OpcaoSimplesNacional":"NENHUM"},{"OrigemDados":"CNC","CodigoMunicipio":1234567,"TipoAmbiente":"HOMOLOGACAO","Id":1,"CodigoUF":12,"InfCad":{"Inscricao":"99999999999999","TpInscricao":"CNPJ","InscricaoMunicipal":"7654321","DataInicioInscricaoMunicipal":"2026-08-13T20:37:46.0657552-03:00","DataApenasInicioInscricaoMunicipal":"2026-08-13","RazaoSocial":"Razao Social","InfoEndereco":{"CEP":"12345678","Logradouro":"Logradouro","Numero":"123","Complemento":"Complemento","Bairro":"Bairro"},"Telefone":"1234567890","Email":"email@email.com","SituacaoEmissaoNFSe":"NAO_HABILITADO","SituacaoCadastral":"1","MotivoSituacaoCadastral":"Motivo"},"DhCadastro":"2026-08-13T20:37:46.0657553-03:00","DhAtualizacao":"2026-08-13T20:37:46.0657555-03:00","OpcaoSimplesNacional":"NENHUM"}],"StatusProcessamento":"DOCUMENTOS_LOCALIZADOS","Alertas":[],"Erros":[],"TipoAmbiente":"HOMOLOGACAO","VersaoAplicativo":"1.0.0.0","DataHoraProcessamento":"2026-08-13T20:37:46.0657882-03:00"}
+ },
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ExemploRetornoSucessoCadastro"
+ },
+ "example": {"ListaCadastroMunicipal":[{"OrigemDados":"CNC","CodigoMunicipio":1234567,"TipoAmbiente":"HOMOLOGACAO","Id":1,"CodigoUF":12,"InfCad":{"Inscricao":"99999999999999","TpInscricao":"CNPJ","InscricaoMunicipal":"1234567","DataInicioInscricaoMunicipal":"2026-08-13T20:37:46.0657532-03:00","DataApenasInicioInscricaoMunicipal":"2026-08-13","RazaoSocial":"Razao Social","InfoEndereco":{"CEP":"12345678","Logradouro":"Logradouro","Numero":"123","Complemento":"Complemento","Bairro":"Bairro"},"Telefone":"1234567890","Email":"email@email.com","SituacaoEmissaoNFSe":"HABILITADO","SituacaoCadastral":"1","MotivoSituacaoCadastral":"Motivo"},"DhCadastro":"2026-08-13T20:37:46.0657534-03:00","DhAtualizacao":"2026-08-13T20:37:46.0657536-03:00","OpcaoSimplesNacional":"NENHUM"},{"OrigemDados":"CNC","CodigoMunicipio":1234567,"TipoAmbiente":"HOMOLOGACAO","Id":1,"CodigoUF":12,"InfCad":{"Inscricao":"99999999999999","TpInscricao":"CNPJ","InscricaoMunicipal":"7654321","DataInicioInscricaoMunicipal":"2026-08-13T20:37:46.0657552-03:00","DataApenasInicioInscricaoMunicipal":"2026-08-13","RazaoSocial":"Razao Social","InfoEndereco":{"CEP":"12345678","Logradouro":"Logradouro","Numero":"123","Complemento":"Complemento","Bairro":"Bairro"},"Telefone":"1234567890","Email":"email@email.com","SituacaoEmissaoNFSe":"NAO_HABILITADO","SituacaoCadastral":"1","MotivoSituacaoCadastral":"Motivo"},"DhCadastro":"2026-08-13T20:37:46.0657553-03:00","DhAtualizacao":"2026-08-13T20:37:46.0657555-03:00","OpcaoSimplesNacional":"NENHUM"}],"StatusProcessamento":"DOCUMENTOS_LOCALIZADOS","Alertas":[],"Erros":[],"TipoAmbiente":"HOMOLOGACAO","VersaoAplicativo":"1.0.0.0","DataHoraProcessamento":"2026-08-13T20:37:46.0657882-03:00"}
+ },
+ "text/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ExemploRetornoSucessoCadastro"
+ },
+ "example": {"ListaCadastroMunicipal":[{"OrigemDados":"CNC","CodigoMunicipio":1234567,"TipoAmbiente":"HOMOLOGACAO","Id":1,"CodigoUF":12,"InfCad":{"Inscricao":"99999999999999","TpInscricao":"CNPJ","InscricaoMunicipal":"1234567","DataInicioInscricaoMunicipal":"2026-08-13T20:37:46.0657532-03:00","DataApenasInicioInscricaoMunicipal":"2026-08-13","RazaoSocial":"Razao Social","InfoEndereco":{"CEP":"12345678","Logradouro":"Logradouro","Numero":"123","Complemento":"Complemento","Bairro":"Bairro"},"Telefone":"1234567890","Email":"email@email.com","SituacaoEmissaoNFSe":"HABILITADO","SituacaoCadastral":"1","MotivoSituacaoCadastral":"Motivo"},"DhCadastro":"2026-08-13T20:37:46.0657534-03:00","DhAtualizacao":"2026-08-13T20:37:46.0657536-03:00","OpcaoSimplesNacional":"NENHUM"},{"OrigemDados":"CNC","CodigoMunicipio":1234567,"TipoAmbiente":"HOMOLOGACAO","Id":1,"CodigoUF":12,"InfCad":{"Inscricao":"99999999999999","TpInscricao":"CNPJ","InscricaoMunicipal":"7654321","DataInicioInscricaoMunicipal":"2026-08-13T20:37:46.0657552-03:00","DataApenasInicioInscricaoMunicipal":"2026-08-13","RazaoSocial":"Razao Social","InfoEndereco":{"CEP":"12345678","Logradouro":"Logradouro","Numero":"123","Complemento":"Complemento","Bairro":"Bairro"},"Telefone":"1234567890","Email":"email@email.com","SituacaoEmissaoNFSe":"NAO_HABILITADO","SituacaoCadastral":"1","MotivoSituacaoCadastral":"Motivo"},"DhCadastro":"2026-08-13T20:37:46.0657553-03:00","DhAtualizacao":"2026-08-13T20:37:46.0657555-03:00","OpcaoSimplesNacional":"NENHUM"}],"StatusProcessamento":"DOCUMENTOS_LOCALIZADOS","Alertas":[],"Erros":[],"TipoAmbiente":"HOMOLOGACAO","VersaoAplicativo":"1.0.0.0","DataHoraProcessamento":"2026-08-13T20:37:46.0657882-03:00"}
+ },
+ "application/xml": {
+ "schema": {
+ "$ref": "#/components/schemas/ExemploRetornoSucessoCadastro"
+ },
+ "example": "
Protocolo de comunicação: TLS 1.0, TLS 1.1 e TLS 1.2 com autenticação mútua
Formato para troca de mensagens: JSON
Formato dos documentos da NFS-e: XML 1.0 (https://www.w3.org/TR/REC-xml)
Codificação de caracteres: UTF-8
Certificado digital: Emitido por Autoridade Certificadora ICP-Brasil, tipo A1 ou A3, CNPJ ou CPF, com \"Autenticação Cliente\"
Padrão de assinatura dos documentos XML: XMLDSIG (https://www.w3.org/TR/xmldsig-core/)
Padrão de compactação dos documentos XML para troca de mensagens: GZip com representação base64binary