Skip to content

feat: build complete decision-flow NFS-e XML - #81

Merged
vitormattos merged 2 commits into
mainfrom
feat/decision-nfse-builder
Oct 4, 2026
Merged

vitormattos merged 2 commits into
mainfrom
feat/decision-nfse-builder

Conversation

@vitormattos

Copy link
Copy Markdown
Member

Advances #56 and #48.

Summary

  • add typed DTOs for the complete NFS-e fields owned by the contributor in the administrative/judicial decision flow
  • build a complete NFSe containing the normal DPS plus fields normally generated by the platform
  • enforce documented bypass invariants: cStat=102, ambGer=2, tpEmis=1, and dhProc=dhEmi
  • implement the 53-position NFS-e identifier and Mod-11 access-key check digit
  • add the production NFSe_v1.01.xsd to the integrity-pinned schema bundle
  • validate a cryptographically signed representative document against that XSD
  • document through regression testing the current official contradiction: the decision manual prescribes nDFSe=0, while schema v1.01 requires [1-9][0-9]{0,12}

Deliberate boundary

This PR does not add the POST transport yet. It establishes the exact document contract first. It also rejects DPS-level IBS/CBS input for this flow until the complete NFS-e-level calculated IBS/CBS group is modeled; silently omitting those calculated values would be incorrect.

Normal emit(DpsData) behavior is untouched.

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
@vitormattos
vitormattos merged commit 1456bba into main Oct 4, 2026
11 checks passed
@vitormattos
vitormattos deleted the feat/decision-nfse-builder branch October 4, 2026 23:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant