Repository navigation
feat: complete source-backed NT009 optional preview groups (issue 95) - #104
Merged
Merged
Conversation
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
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.
Follow-up to issue #95 (NT009 v1.01)
Base:
mainat2a8b660c4f4471d62a79d7aa64597740bc9ae2adafter #103.Implemented from the checksum-pinned official Annex VI v1.04.01 matrix
IBSCBS/indZFMALC: operation-indicator whitelist in Annex VI row 377 plus explicit caller verification of ZFM/ALC geographical eligibility; no inferred zero CBS amounts.IBSCBS/tpOperandgRefNFSe/refNFSe(rows 378–380): document-operation codes 1–5 and required 1–99 explicitly supplied prior invoice keys whentpOperis 2/3.IBSCBS/tpEnteGov(row 381): codes 1–4 with caller-verified government-purchase context.IBSCBS/indDoacao(row 382): opt-in explicitly classified donation without consideration; no inferred classification/credit amounts.IBSCBS/valores/trib/gIBSCBS/gTribRegular(rows 431–433) andgDif(rows 434–437): typed DTOs and cardinality/format checks.No change to the existing
DpsDataconstructor,XmlBuilder::buildDps(),NfseClient::emit(),DpsSchemaValidatoror Akaunting dependency. All new arguments are opt-in and appended to the NT009 preview DTO. Published Annex VII v1.03.00 codes are verified throughOfficialDomainCatalog. Advisory Annex VIII is not enforced.What this PR does not (and cannot yet) certify
As of 2026-10-09, the official RTC page publishes NT009 v1.01 and Annexes VI/VII, but its production documentation still identifies
NFSe-ESQUEMAS_XSD-v1.01-20260209and its restricted production documentationNFSe-ESQUEMAS_XSD-PRODREST-v1.01-20260727. Neither is identified as an effective NT009 v1.04.01 contract for the target SEFIN environment. The NT009 PDF and Annex VI also disagree about thegIBSCBSAjusteparent. Fiscal tax-domain repercussions and SEFIN acceptance are not established.Consequently, these models remain review-only. It would be unsafe to introduce the new draft structure into the real emitter or claim all production acceptance criteria are met. Do not mark issue #95 as completed merely because this structural PR merges; reconcile the normative activation evidence and test against an official effective XSD first.
Verification
tests/Unit/Xml/Nt009DpsPreviewBuilderTest.php. The first attempted unified patches failedgit apply --check(not network fetch); fixed with a complete-file upsert in signed commitfb5a87889ee860cea631c5b2a141c3bae9cae4c4. The verified follow-up diff changes only two import positions. All six GitHub Actions workflows were restarted on this commit and their results are pending; do not merge until green.Official pages: https://www.gov.br/nfse/pt-br/biblioteca/documentacao-tecnica/rtc ; https://www.gov.br/nfse/pt-br/biblioteca/documentacao-tecnica/documentacao-atual ; https://www.gov.br/nfse/pt-br/biblioteca/documentacao-tecnica/producao-restrita .