Outcome
Make nfse-php a robust, reusable protocol layer for the National NFS-e ecosystem, with versioned official contracts, complete contributor operations, strict validation and testable transport/security boundaries.
Why
The library already covers emission, DPS recovery, query, cancellation, selected event lookup, ADN distribution, municipal parameters, DANFSe v2, IBS/CBS, foreign takers and XML signature integrity. The remaining gaps are protocol completeness and preservation of testable architecture while the protocol surface grows.
A comparison with other National NFS-e SDKs found a recurring failure mode: clients/services gradually accumulate XML construction, certificate handling, signing, HTTP, retry and parsing responsibilities. #60 therefore requires a characterization-first architecture audit before major new protocol features are allowed to increase that coupling.
Other open implementations demonstrate useful patterns: versioned official XSD fixtures, domain-table snapshots, integration fixtures, explicit transport abstractions and substitution/event coverage. The official National NFS-e API also supports substitution semantics and generic event operations beyond the current convenience methods.
Scope
- official schema/version lifecycle and XSD validation
- NFS-e substitution support
- complete generic SEFIN event operations
- versioned official domain/correlation tables
- received-signature trust verification separated from integrity verification
- injectable/testable HTTP transport and safe retry policy
- sanitized official response fixtures/contract tests
- remaining production fiscal groups such as deductions/reductions/benefits and administrative/judicial decision emission
Out of scope
- Akaunting UI/persistence
- municipality-specific legacy SOAP providers
- NFS-e Via/concessionaire features unless they become applicable to the normal contributor API
- silently inferring tax treatment
- unsafe retries of mutating fiscal operations
Success criteria
- generated DPS/event XML is validated against the exact supported official XSD release
- protocol versions and official tables are explicit and auditable
- substitution and event lifecycle are represented without Akaunting-specific assumptions
- transport behavior is injectable and deterministic in tests
- XML signature integrity and certificate trust are distinct concepts in the API
- fixture tests cover success, rejection, timeout and malformed upstream payloads
Definition of done
- all child issues complete
- public API changes documented with migration notes
- compatibility tests pass on supported PHP versions and minimum dependency set
- no cross-layer Akaunting dependency introduced
Intended GitHub issue type: Epic.
Child issues
Outcome
Make
nfse-phpa robust, reusable protocol layer for the National NFS-e ecosystem, with versioned official contracts, complete contributor operations, strict validation and testable transport/security boundaries.Why
The library already covers emission, DPS recovery, query, cancellation, selected event lookup, ADN distribution, municipal parameters, DANFSe v2, IBS/CBS, foreign takers and XML signature integrity. The remaining gaps are protocol completeness and preservation of testable architecture while the protocol surface grows.
A comparison with other National NFS-e SDKs found a recurring failure mode: clients/services gradually accumulate XML construction, certificate handling, signing, HTTP, retry and parsing responsibilities. #60 therefore requires a characterization-first architecture audit before major new protocol features are allowed to increase that coupling.
Other open implementations demonstrate useful patterns: versioned official XSD fixtures, domain-table snapshots, integration fixtures, explicit transport abstractions and substitution/event coverage. The official National NFS-e API also supports substitution semantics and generic event operations beyond the current convenience methods.
Scope
Out of scope
Success criteria
Definition of done
Child issues