feat(inbound): implementa recurso InboundProductInvoices (NF-e Distribuição)#19
Merged
andrekutianski merged 1 commit intodevelopfrom Feb 14, 2026
Merged
Conversation
…buição) Adiciona suporte completo à API consulta-nfe-distribuicao-v1 para consulta de NF-e recebidas via Distribuição DFe (SEFAZ), seguindo o padrão do TransportationInvoicesResource existente. ## Novos arquivos - src/core/resources/inbound-product-invoices.ts Classe InboundProductInvoicesResource com 13 métodos públicos: - enableAutoFetch / disableAutoFetch / getSettings (gerenciamento) - getDetails / getProductInvoiceDetails (consulta webhook v1/v2) - getEventDetails / getProductInvoiceEventDetails (eventos) - getXml / getEventXml / getPdf / getJson (downloads) - manifest (Manifestação do Destinatário: 210210/210220/210240) - reprocessWebhook (reprocessar por chave de acesso ou NSU) - tests/unit/resources/inbound-product-invoices.test.ts 31 testes unitários cobrindo validação de parâmetros, caminhos HTTP corretos, métodos HTTP corretos e valores de retorno. - examples/inbound-product-invoices.js Exemplo completo demonstrando todos os fluxos principais. ## Arquivos modificados - src/core/types.ts 12 novos tipos/interfaces: InboundInvoiceMetadata, InboundProductInvoiceMetadata, InboundSettings, EnableInboundOptions, ManifestEventType, InboundCompany, InboundIssuer, InboundBuyer, InboundTransportation, InboundLinks, InboundProductInvoice, AutomaticManifesting. - src/core/client.ts Lazy getter `inboundProductInvoices` usando cteHttp (api.nfse.io). - src/core/resources/index.ts Export do InboundProductInvoicesResource. - src/index.ts Re-exports de todos os tipos de NF-e Distribuição. - docs/API.md Referência completa da API com assinaturas, tabelas de parâmetros, tabelas de resposta e exemplos de código para todos os 13 métodos. - README.md Seção "NF-e de Entrada - Distribuição" com exemplos de uso em português e tabela de tipos de manifestação. ## Decisões técnicas - Reutiliza o HttpClient de CT-e (mesmo host api.nfse.io) - Tipos handwritten (nomes gerados são ilegíveis: Sucessonarequisio) - tpEvent do manifest é passado como query param na URL - Webhook v2 (getProductInvoice*) omite nsuParent/nfeSerialNumber/ operationType e adiciona productInvoices[] - Validação de chave de acesso: 44 dígitos numéricos
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adiciona suporte completo à API consulta-nfe-distribuicao-v1 para consulta de NF-e recebidas via Distribuição DFe (SEFAZ), seguindo o padrão do TransportationInvoicesResource existente.
Novos arquivos
src/core/resources/inbound-product-invoices.ts Classe InboundProductInvoicesResource com 13 métodos públicos:
tests/unit/resources/inbound-product-invoices.test.ts 31 testes unitários cobrindo validação de parâmetros, caminhos HTTP corretos, métodos HTTP corretos e valores de retorno.
examples/inbound-product-invoices.js Exemplo completo demonstrando todos os fluxos principais.
Arquivos modificados
src/core/types.ts 12 novos tipos/interfaces: InboundInvoiceMetadata, InboundProductInvoiceMetadata, InboundSettings, EnableInboundOptions, ManifestEventType, InboundCompany, InboundIssuer, InboundBuyer, InboundTransportation, InboundLinks, InboundProductInvoice, AutomaticManifesting.
src/core/client.ts Lazy getter
inboundProductInvoicesusando cteHttp (api.nfse.io).src/core/resources/index.ts Export do InboundProductInvoicesResource.
src/index.ts Re-exports de todos os tipos de NF-e Distribuição.
docs/API.md Referência completa da API com assinaturas, tabelas de parâmetros, tabelas de resposta e exemplos de código para todos os 13 métodos.
README.md Seção "NF-e de Entrada - Distribuição" com exemplos de uso em português e tabela de tipos de manifestação.
Decisões técnicas