Liking cljdoc? Tell your friends :D

brazilian-utils.processo-juridico.core


format-processoclj/s

(format-processo processo)

Formats a court case number with the standard judicial mask (NNNNNNN-DD.AAAA.J.TT.OOOO).

This function takes a 20-digit court case number and formats it according to the Brazilian judicial system standard. It supports partial input (preserving the number of digits) and discards extra digits beyond 20.

Arguments: processo - Court case number string (formatted or unformatted)

Returns: Formatted string with the mask; partial input stays partial; extra digits are discarded

Examples: (format-processo "00020802520125150049") ;; => "0002080-25.2012.515.0049" (format-processo "0002080") ;; => "0002080" (format-processo "") ;; => "" (format-processo "0002080-25.2012.515.0049") ;; => "0002080-25.2012.515.0049"

Formats a court case number with the standard judicial mask (NNNNNNN-DD.AAAA.J.TT.OOOO).

This function takes a 20-digit court case number and formats it according to the
Brazilian judicial system standard. It supports partial input (preserving the number
of digits) and discards extra digits beyond 20.

Arguments:
  processo - Court case number string (formatted or unformatted)

Returns:
  Formatted string with the mask; partial input stays partial; extra digits are discarded

Examples:
  (format-processo "00020802520125150049") ;; => "0002080-25.2012.515.0049"
  (format-processo "0002080")              ;; => "0002080"
  (format-processo "")                      ;; => ""
  (format-processo "0002080-25.2012.515.0049") ;; => "0002080-25.2012.515.0049"
sourceraw docstring

is-valid?clj/s

(is-valid? processo)

Validates a Brazilian court case number (processo judicial).

This function checks if a court case number is valid by verifying:

  • It is a string
  • Contains exactly 20 digits (after removing formatting)
  • The formatting follows the standard judicial mask (NNNNNNN-DD.AAAA.J.TT.OOOO)
  • The check digits (mod 97-10 algorithm) are correct

Accepts both formatted (NNNNNNN-DD.AAAA.J.TT.OOOO) and unformatted (20 digits) court case numbers.

Arguments: processo - Court case number string (formatted or unformatted)

Returns: true if valid; false otherwise

Examples: (is-valid? "0002080-25.2012.515.0049") ;; true/false depending on check digits (is-valid? "00020802520125150049") ;; true/false depending on check digits (is-valid? "0002080") ;; false (incomplete) (is-valid? nil) ;; false

Validates a Brazilian court case number (processo judicial).

This function checks if a court case number is valid by verifying:
- It is a string
- Contains exactly 20 digits (after removing formatting)
- The formatting follows the standard judicial mask (NNNNNNN-DD.AAAA.J.TT.OOOO)
- The check digits (mod 97-10 algorithm) are correct

Accepts both formatted (NNNNNNN-DD.AAAA.J.TT.OOOO) and unformatted (20 digits) court case numbers.

Arguments:
  processo - Court case number string (formatted or unformatted)

Returns:
  true if valid; false otherwise

Examples:
  (is-valid? "0002080-25.2012.515.0049") ;; true/false depending on check digits
  (is-valid? "00020802520125150049")     ;; true/false depending on check digits
  (is-valid? "0002080")                  ;; false (incomplete)
  (is-valid? nil)                            ;; false
sourceraw docstring

remove-symbolsclj/s

(remove-symbols processo)

Removes all non-numeric characters from a court case number.

This function normalizes court case number input by stripping formatting characters, returning only the digits.

Arguments: processo - Court case number string (formatted or unformatted); nil allowed

Returns: Digits-only string; nil yields an empty string

Examples: (remove-symbols "0002080-25.2012.515.0049") ;; => "00020802520125150049" (remove-symbols "00020802520125150049") ;; => "00020802520125150049" (remove-symbols nil) ;; => "" (remove-symbols "") ;; => ""

Removes all non-numeric characters from a court case number.

This function normalizes court case number input by stripping formatting characters,
returning only the digits.

Arguments:
  processo - Court case number string (formatted or unformatted); nil allowed

Returns:
  Digits-only string; nil yields an empty string

Examples:
  (remove-symbols "0002080-25.2012.515.0049") ;; => "00020802520125150049"
  (remove-symbols "00020802520125150049")     ;; => "00020802520125150049"
  (remove-symbols nil)                           ;; => ""
  (remove-symbols "")                        ;; => ""
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