Skip to content

fix: model official NFS-e cancellation reasons - #92

Merged
vitormattos merged 3 commits into
mainfrom
fix/342-cancellation-contract
Oct 8, 2026
Merged

vitormattos merged 3 commits into
mainfrom
fix/342-cancellation-contract

Conversation

@vitormattos

Copy link
Copy Markdown
Member

Summary

Implements the library side of LibreCodeCoop/akaunting-nfse#342.

  • adds an explicit structured cancellation contract;
  • accepts the official e101101 reason codes 1, 2 and 9;
  • validates xMotivo locally at 15–255 characters before any request;
  • emits cMotivo and xMotivo as separate XML fields;
  • retains the legacy cancel(chave, motivo) method as a compatibility wrapper using reason code 1;
  • adds boundary and official-XSD regression coverage.

The Akaunting module can now map its UI choices to fiscal codes without concatenating labels into xMotivo.

Related: LibreCodeCoop/akaunting-nfse#342

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
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 d2fd12b into main Oct 8, 2026
11 checks passed
@vitormattos
vitormattos deleted the fix/342-cancellation-contract branch October 8, 2026 01:31
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