Skip to content

Refactor parsers into subclasses, fix SOAP envelope, add specs#19

Merged
keithyoder merged 4 commits into
mainfrom
fix-status-consulta
May 18, 2026
Merged

Refactor parsers into subclasses, fix SOAP envelope, add specs#19
keithyoder merged 4 commits into
mainfrom
fix-status-consulta

Conversation

@keithyoder
Copy link
Copy Markdown
Owner

Parser refactor:

  • Replace ResponseParser with Base + Autorizacao, Status, Consulta, Inutilizacao subclasses, each with a single #parse method
  • Update client.rb to use new parser classes

SOAP fixes:

  • Fix SOAPAction in webservices/status.rb (nfcomStatusServicoNF)
  • Fix montar_envelope in webservices/base.rb: use soap: prefix instead of soap12:, wrap body with nfcomDadosMsg, run through XmlCleaner
  • Fix consulta.rb: use nfcomDadosMsg wrapper, add missing xServ field

DANFE-COM:

  • Disable prawn-svg web requests (enable_web_requests: false) in both pdf.svg call sites

Specs:

  • Add shared contexts for mocked certificate and default configuration
  • Add parser specs for all four subclasses
  • Add webservice specs for status and consulta
  • Update autorizacao and signature specs to use shared contexts
  • Update client_spec to use new parser class names
  • Add model specs for Emitente and Destinatario
  • Add DanfeCom builder spec with synthetic fixture XML
  • Delete response_parser_spec.rb

Parser refactor:
- Replace ResponseParser with Base + Autorizacao, Status, Consulta,
  Inutilizacao subclasses, each with a single #parse method
- Update client.rb to use new parser classes

SOAP fixes:
- Fix SOAPAction in webservices/status.rb (nfcomStatusServicoNF)
- Fix montar_envelope in webservices/base.rb: use soap: prefix instead
  of soap12:, wrap body with nfcomDadosMsg, run through XmlCleaner
- Fix consulta.rb: use nfcomDadosMsg wrapper, add missing xServ field

DANFE-COM:
- Disable prawn-svg web requests (enable_web_requests: false) in both
  pdf.svg call sites

Specs:
- Add shared contexts for mocked certificate and default configuration
- Add parser specs for all four subclasses
- Add webservice specs for status and consulta
- Update autorizacao and signature specs to use shared contexts
- Update client_spec to use new parser class names
- Add model specs for Emitente and Destinatario
- Add DanfeCom builder spec with synthetic fixture XML
- Delete response_parser_spec.rb
@keithyoder keithyoder self-assigned this Apr 1, 2026
@keithyoder keithyoder merged commit de272dc into main May 18, 2026
5 checks passed
@keithyoder keithyoder deleted the fix-status-consulta branch May 18, 2026 11:11
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