You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Complete the generic SEFIN event query and registration API #50
The official API exposes a generic event model, including:
POST /nfse/{chaveAcesso}/eventos
GET /nfse/{chaveAcesso}/eventos
GET filtered by event type/sequence
The library currently has cancellation convenience and a single typed event lookup, while ADN also exposes distributed events.
Goal
Expose the complete generic SEFIN event surface while keeping cancellation as a convenience wrapper.
Scope
list all SEFIN events for an access key
filter/query event type and sequence
introduce a generic signed event registration primitive with typed result/error
refactor cancellation to use the generic primitive without behavior change
keep ADN-distributed-event APIs separate from SEFIN event APIs
Constraints
event-specific XML builders must be explicit; do not accept arbitrary unsigned XML as trusted input
no Akaunting dependencies
preserve raw upstream payload/XML for diagnostics without leaking certificate secrets
Tests
list all events
filter by type/sequence
register an event with signed XML
HTTP/rejection/malformed payload cases
cancellation regression through the generic path
Definition of done
endpoint matrix documented
method names distinguish SEFIN from ADN
XSD tests cover registered event XML
cancellation behavior remains compatible
Contract discrepancy found during implementation
The current contributor manual documents:
GET /nfse/{chaveAcesso}/eventos
GET /nfse/{chaveAcesso}/eventos/{tipoEvento}
GET /nfse/{chaveAcesso}/eventos/{tipoEvento}/{numSeqEvento}
However, the production Swagger snapshot reviewed during implementation explicitly defines only the GET endpoint with tipoEvento/numSeqEvento (plus POST on the base path), using EventosPostResponseSucesso as the response shape.
Do not add the base/type-only GET calls blindly. Before implementing them, verify the live/current official Swagger or another authoritative executable contract. If the manual and Swagger remain inconsistent, preserve the discrepancy in documentation and keep only the verified endpoint enabled by default.
This issue may be split into:
verified generic registration/query primitives backed by executable contracts;
optional list/filter GET methods once current production support is proven.
The contributor manual also describes base and type-only GET routes, but the production Swagger snapshot reviewed during implementation does not expose them. Per this issue's own contract-discrepancy rule, those methods were not guessed or enabled blindly. They should only be added if a future authoritative executable contract proves support.
Treating that discrepancy as an explicit evidence-backed rejection keeps the public API honest rather than leaving this issue indefinitely open for endpoints we cannot prove.
Activity
vitormattos commentedon Oct 4, 2026
Verified protocol surface completed; unverified routes intentionally rejected.
Current
mainnow has:POST /nfse/{chaveAcesso}/eventosGET /nfse/{chaveAcesso}/eventos/{tipoEvento}/{numSeqEvento}pedRegEventov1.01 XSD validation and endpoint-matrix documentationThe contributor manual also describes base and type-only GET routes, but the production Swagger snapshot reviewed during implementation does not expose them. Per this issue's own contract-discrepancy rule, those methods were not guessed or enabled blindly. They should only be added if a future authoritative executable contract proves support.
Treating that discrepancy as an explicit evidence-backed rejection keeps the public API honest rather than leaving this issue indefinitely open for endpoints we cannot prove.