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:
2025-11-30 11:04:09 -05:00
parent d197a86454
commit 763e1dba0c
21 changed files with 156 additions and 76 deletions

View File

@@ -5,14 +5,21 @@ defmodule IbanEx.Iban do
alias IbanEx.{Serialize}
@type t :: %__MODULE__{
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 country_code: "UA", check_digits: nil, bank_code: nil, branch_code: nil, national_check: nil, account_number: nil
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
@spec to_map(IbanEx.Iban.t()) :: map()
defdelegate to_map(iban), to: Serialize