2024-03-05 06:02:58 -05:00
|
|
|
defmodule IbanEx.Iban do
|
2024-03-07 18:39:33 -05:00
|
|
|
@moduledoc false
|
|
|
|
|
|
2024-03-05 06:02:58 -05:00
|
|
|
alias IbanEx.Formatter
|
|
|
|
|
alias IbanEx.{Serialize}
|
|
|
|
|
|
|
|
|
|
@type t :: %__MODULE__{
|
2025-11-30 11:04:09 -05:00
|
|
|
iban: String.t(),
|
|
|
|
|
country_code: <<_::16>>,
|
|
|
|
|
check_digits: String.t(),
|
|
|
|
|
bank_code: String.t(),
|
|
|
|
|
branch_code: String.t() | nil,
|
|
|
|
|
national_check: String.t() | nil,
|
|
|
|
|
account_number: String.t()
|
|
|
|
|
}
|
|
|
|
|
defstruct iban: nil,
|
|
|
|
|
country_code: "UA",
|
|
|
|
|
check_digits: nil,
|
|
|
|
|
bank_code: nil,
|
|
|
|
|
branch_code: nil,
|
|
|
|
|
national_check: nil,
|
|
|
|
|
account_number: nil
|
2024-03-05 06:02:58 -05:00
|
|
|
|
|
|
|
|
@spec to_map(IbanEx.Iban.t()) :: map()
|
|
|
|
|
defdelegate to_map(iban), to: Serialize
|
|
|
|
|
|
|
|
|
|
@spec to_string(IbanEx.Iban.t()) :: binary()
|
|
|
|
|
defdelegate to_string(iban), to: Serialize
|
|
|
|
|
|
|
|
|
|
@spec pretty(IbanEx.Iban.t()) :: binary()
|
|
|
|
|
defdelegate pretty(iban), to: Formatter
|
|
|
|
|
|
|
|
|
|
@spec splitted(IbanEx.Iban.t()) :: binary()
|
|
|
|
|
defdelegate splitted(iban), to: Formatter
|
|
|
|
|
|
|
|
|
|
@spec compact(IbanEx.Iban.t()) :: binary()
|
|
|
|
|
defdelegate compact(iban), to: Formatter
|
|
|
|
|
end
|