Repository navigation
fix(mde client): send the envEvento and evento elements, not their types - #168
Merged
Merged
Conversation
The batch and the event were built with the TenvEvento and Tevento complex types, which serialize as <ns2:TEnvEvento> and <TEvento xmlns=""> with ns1 prefixed children: the SEFAZ rejects the batch with cStat 404 (Uso de prefixo de namespace nao permitido). Build the EnvEvento and Evento global elements instead, as the cancel event of the NF-e client does, and match the placeholder with attributes too. The mocked ciencia test now asserts the outgoing envEvento/evento. Checked against the AN homologation environment: the same ciencia da operacao went from cStat 404 to the answer the erpbrasil.edoc path gets (lote 128 processed, event judged on its business rules).
CristianoMafraJunior
approved these changes
Oct 7, 2026
rvalyi
approved these changes
Oct 7, 2026
rvalyi
left a comment
Member
There was a problem hiding this comment.
boa! Realmente esse eu nao tinha testado ainda.
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.
O lote e o evento do MD-e eram montados com os tipos
TenvEvento/Tevento, que serializam como<ns2:TEnvEvento>e<TEvento xmlns="">com os filhos prefixadosns1:. A SEFAZ recusa o lote com 404 – Uso de prefixo de namespace não permitido. Este PR monta os elementos globaisEnvEvento/Evento(como o evento de cancelamento do cliente de NF-e) e a regex do placeholder aceita atributos.Teste A/B no Ambiente Nacional de homologação (pela OCA/l10n-brazil#4147), mesma ciência da operação:
<envEvento xmlns=".../nfe"><ns2:TEnvEvento><envEvento ...>(o 575 é regra de negócio esperada: a chave usada é de nota emitida pelo próprio autor.)
O teste mockado da ciência agora confere o
envEvento/eventono payload. Mesmo tipo de problema do #167, no cliente de MD-e.🤖 Generated with Claude Code