Core types, tax computation, and XML generation for Brazilian fiscal documents.
fiscal-core is the foundation crate of the fiscal-rs workspace. It contains:
- Data types ([
types], [newtypes]) — strongly-typed structs and newtypes for NF-e / NFC-e document data, validated at construction time. - Tax computation ([
tax_icms], [tax_pis_cofins_ipi], [tax_issqn], [tax_is]) — build XML fragments for each Brazilian tax group and accumulate invoice totals. - XML builder ([
xml_builder]) — typestate builder for assembling a complete, schema-compliant NF-e / NFC-e XML document. - Protocol helpers ([
complement], [contingency], [qrcode]) — attach SEFAZ authorization protocols, manage contingency mode, and build NFC-e QR codes. - Utilities ([
format_utils], [xml_utils], [gtin], [state_codes], [status_codes], [constants]) — formatting, XML escaping, GTIN validation, IBGE state code lookups, and SEFAZ status-code constants. - Conversion ([
convert], [standardize]) — TXT-to-XML converter and XML type identification / JSON conversion. - Traits ([
traits]) — sealedTaxCalculationandXmlSerializabletraits.