Liking cljdoc? Tell your friends :D

brazilian-utils.boleto.schemas

Malli schemas and input normalization for boleto processing.

Provides schemas for validating and normalizing digitable line inputs.

Malli schemas and input normalization for boleto processing.

Provides schemas for validating and normalizing digitable line inputs.
raw docstring

DigitableLineInputclj/s

Schema for digitable line input (formatted or unformatted).

Accepts strings with 46, 47, or 48 digits after stripping non-numeric characters.

  • 46 digits: Bank boleto without one digit (will be padded to 47)
  • 47 digits: Bank boleto (bancário)
  • 48 digits: Collection boleto (arrecadação)
Schema for digitable line input (formatted or unformatted).

Accepts strings with 46, 47, or 48 digits after stripping non-numeric characters.
- 46 digits: Bank boleto without one digit (will be padded to 47)
- 47 digits: Bank boleto (bancário)
- 48 digits: Collection boleto (arrecadação)
sourceraw docstring

parse-digitable-lineclj/s

(parse-digitable-line value)

Normalizes and classifies a digitable line input.

Strips non-numeric characters, applies padding if needed (46->47 digits), and determines the boleto type based on digit count and first digit.

Args: value - String containing digitable line (may include formatting)

Returns: Map with :digits (normalized string) and :kind (:bancario or :arrecadacao), or nil if input is invalid

Examples: (parse-digitable-line "23790.00000 00000.000000 00000.000000 0 00000000000000") ;; => {:digits "23790000000000000000000000000000000000000000000" :kind :bancario}

(parse-digitable-line "848600000000123456789012345678901234567890123456") ;; => {:digits "848600000000123456789012345678901234567890123456" :kind :arrecadacao}

Normalizes and classifies a digitable line input.

Strips non-numeric characters, applies padding if needed (46->47 digits),
and determines the boleto type based on digit count and first digit.

Args:
  value - String containing digitable line (may include formatting)

Returns:
  Map with :digits (normalized string) and :kind (:bancario or :arrecadacao),
  or nil if input is invalid

Examples:
  (parse-digitable-line "23790.00000 00000.000000 00000.000000 0 00000000000000")
  ;; => {:digits "23790000000000000000000000000000000000000000000" :kind :bancario}
  
  (parse-digitable-line "848600000000123456789012345678901234567890123456")
  ;; => {:digits "848600000000123456789012345678901234567890123456" :kind :arrecadacao}
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close