Skip to main content

Module xml_builder

Module xml_builder 

Source
Expand description

Typestate XML builder for NF-e / NFC-e documents. NF-e/NFC-e XML builder module.

Provides [InvoiceBuilder] — a typestate builder that enforces the invoice lifecycle at compile time:

InvoiceBuilder::new(issuer, env, model)   // Draft
    .series(1)
    .invoice_number(42)
    .add_item(item)
    .recipient(recipient)
    .payments(vec![payment])
    .build()?                              // Built
    .sign_with(|xml| sign(xml))?           // Signed
    .signed_xml()                          // &str

Re-exports§

pub use access_key::build_access_key;

Modules§

access_key
Access key (chave de acesso) generation for NF-e/NFC-e.
dest
Build the <dest> (recipient) group of the NF-e XML.
det
Build <det> (item detail) elements of the NF-e XML.
emit
Build the <emit> (issuer/emitter) group of the NF-e XML.
ide
Build the <ide> (identification) group of the NF-e XML.
optional
Build optional XML groups: cobr, infAdic, infIntermed, exporta, compra, infRespTec, retirada, entrega, autXML.
pag
Build the <pag> (payment) group of the NF-e XML.
tax_id
TaxId value object for CPF/CNPJ detection and XML tag generation.
total
Build the <total> group of the NF-e XML.
transp
Build the <transp> (transport) group of the NF-e XML.

Structs§

Built
Marker: invoice has been built (XML and access key available, no setters).
Draft
Marker: invoice is being assembled (setters available, no XML yet).
InvoiceBuilder
Typestate builder for NF-e / NFC-e XML documents.
Signed
Marker: invoice has been signed (signed XML available).