ADD IBAN FIELD TO STRUCTS AND UPDATE PARSING LOGIC
- Added `iban` field to the `IbanEx.Iban` struct to hold the full IBAN value. - Updated the parsing logic to populate the new field. - Adjusted BBAN rules and tests for France and Brazil to reflect updated structures. - Improved error handling and format validation routines.
This commit is contained in:
@@ -8,7 +8,7 @@ defmodule IbanEx.Formatter do
|
||||
|
||||
@type iban() :: IbanEx.Iban.t()
|
||||
@type available_format() :: :compact | :pretty | :splitted
|
||||
@type available_formats_list() :: [:compact | :pretty | :splitted ]
|
||||
@type available_formats_list() :: [:compact | :pretty | :splitted]
|
||||
|
||||
@spec available_formats() :: available_formats_list()
|
||||
def available_formats(), do: @available_formats
|
||||
@@ -25,6 +25,7 @@ def splitted(iban), do: format(iban, :splitted)
|
||||
@spec format(iban()) :: String.t()
|
||||
@spec format(iban(), available_format()) :: String.t()
|
||||
def format(iban, format \\ :compact)
|
||||
|
||||
def format(iban, :compact),
|
||||
do: format(iban, :pretty) |> normalize()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user