Shared type definitions and helper guards used across clearbank.
Summary
Types
Account number — 8 digits
Monetary amount as a Decimal-compatible string, e.g. 1000.00
BIC / SWIFT code
ISO 4217 currency code, e.g. GBP, EUR, USD
ISO 8601 datetime string
IBAN string
Paginated response wrapper
Standard pagination params
Sort code — 6 digits, no dashes, e.g. 040004
UUID v4 string
Functions
Appends query params to a path, only if params is non-empty.
Converts a keyword list or map to a query string, dropping nil values.
Types
@type account_number() :: String.t()
Account number — 8 digits
@type amount() :: String.t()
Monetary amount as a Decimal-compatible string, e.g. 1000.00
@type bic() :: String.t()
BIC / SWIFT code
@type currency_code() :: String.t()
ISO 4217 currency code, e.g. GBP, EUR, USD
@type datetime() :: String.t()
ISO 8601 datetime string
@type iban() :: String.t()
IBAN string
@type paginated(t) :: %{ data: [t], total_count: non_neg_integer(), page_number: pos_integer(), page_size: pos_integer() }
Paginated response wrapper
@type pagination_params() :: %{ optional(:page_number) => pos_integer(), optional(:page_size) => pos_integer() }
Standard pagination params
@type sort_code() :: String.t()
Sort code — 6 digits, no dashes, e.g. 040004
@type uuid() :: String.t()
UUID v4 string