Skip to main content

sunat_cpe_core 0.1.0 copy "sunat_cpe_core: ^0.1.0" to clipboard
sunat_cpe_core: ^0.1.0 copied to clipboard

Core domain entities, SUNAT catalogs, math validator, UBL 2.1 XML builder, XAdES-BES signer, and OSE/PSE contracts for Peru.

sunat_cpe_core #

Core domain entities, official SUNAT Anexo N° 8 catalogs, strict passthrough mathematical validator, UBL 2.1/2.0 XML builder, pure-Dart XAdES-BES (RSA-SHA256) digital signer, and unified OSE/PSE provider contracts for Peruvian Electronic Invoicing (CPE).

Features #

  • 100% Pure Dart 3: Sealed domain hierarchies (CpeDocument, SalesCpeDocument, CpeResult<T>) with zero build_runner codegen overhead.
  • Exact Financial Precision: Uses Decimal for all monetary totals, unit values, quantities, and tax rates.
  • Strict Passthrough Validation (CpeMathValidator): Verifies line-level and header-level UBL 2.1 equations, free-item rules, and RS 000193-2020 credit installment net pending amounts before network calls.
  • Native UBL 2.1 & XAdES-BES Engine: Generates UBL 2.1/2.0 XML, signs with RSA-SHA256 C14N (XadesBesSigner), packages .zip payloads, and parses <ApplicationResponse> CDR archives (CpeZipCodec).
  • Unified OseProvider Contract: Supports synchronous emission, asynchronous Ticket polling with exponential backoff (pollTicketUntilDone), and status queries across OSE and PSE adapters.

Usage #

import 'package:sunat_cpe_core/sunat_cpe_core.dart';

void main() {
  final validator = CpeMathValidator();
  // Validate any CpeDocument before sending to an OSE/PSE provider
}
0
likes
0
points
587
downloads

Publisher

unverified uploader

Weekly Downloads

Core domain entities, SUNAT catalogs, math validator, UBL 2.1 XML builder, XAdES-BES signer, and OSE/PSE contracts for Peru.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

archive, crypto, decimal, http, pointycastle, xml

More

Packages that depend on sunat_cpe_core