Added first non SEPA countries

This commit is contained in:
2024-05-14 19:15:55 -04:00
parent 4abf01b752
commit 384b9b7a39
75 changed files with 1653 additions and 170 deletions

View File

@@ -7,42 +7,74 @@ defmodule IbanEx.Country do
@type error_tuple() :: {:error, atom()}
@supported_countries %{
"AD" => IbanEx.Country.AD,
"AE" => IbanEx.Country.AE,
"AL" => IbanEx.Country.AL,
"AT" => IbanEx.Country.AT,
"AZ" => IbanEx.Country.AZ,
"BA" => IbanEx.Country.BA,
"BE" => IbanEx.Country.BE,
"BG" => IbanEx.Country.BG,
"BH" => IbanEx.Country.BH,
"BR" => IbanEx.Country.BR,
"CH" => IbanEx.Country.CH,
"CR" => IbanEx.Country.CR,
"CY" => IbanEx.Country.CY,
"CZ" => IbanEx.Country.CZ,
"DE" => IbanEx.Country.DE,
"DO" => IbanEx.Country.DO,
"DK" => IbanEx.Country.DK,
"EE" => IbanEx.Country.EE,
"ES" => IbanEx.Country.ES,
"EG" => IbanEx.Country.EG,
"FI" => IbanEx.Country.FI,
"FR" => IbanEx.Country.FR,
"FO" => IbanEx.Country.FO,
"GB" => IbanEx.Country.GB,
"GE" => IbanEx.Country.GE,
"GI" => IbanEx.Country.GI,
"GL" => IbanEx.Country.GL,
"GR" => IbanEx.Country.GR,
"GT" => IbanEx.Country.GT,
"HR" => IbanEx.Country.HR,
"HU" => IbanEx.Country.HU,
"IE" => IbanEx.Country.IE,
"IL" => IbanEx.Country.IL,
"IT" => IbanEx.Country.IT,
"JO" => IbanEx.Country.JO,
"KZ" => IbanEx.Country.KZ,
"KW" => IbanEx.Country.KW,
"LB" => IbanEx.Country.LB,
"LI" => IbanEx.Country.LI,
"LT" => IbanEx.Country.LT,
"LU" => IbanEx.Country.LU,
"LV" => IbanEx.Country.LV,
"MC" => IbanEx.Country.MC,
"MD" => IbanEx.Country.MD,
"ME" => IbanEx.Country.ME,
"MK" => IbanEx.Country.MK,
"MR" => IbanEx.Country.MR,
"MT" => IbanEx.Country.MT,
"NL" => IbanEx.Country.NL,
"NO" => IbanEx.Country.NO,
"PL" => IbanEx.Country.PL,
"PT" => IbanEx.Country.PT,
"PK" => IbanEx.Country.PK,
"QA" => IbanEx.Country.QA,
"RO" => IbanEx.Country.RO,
"RS" => IbanEx.Country.RS,
"SA" => IbanEx.Country.SA,
"SE" => IbanEx.Country.SE,
"SM" => IbanEx.Country.SM,
"SI" => IbanEx.Country.SI,
"SK" => IbanEx.Country.SK,
"SM" => IbanEx.Country.SM,
"SV" => IbanEx.Country.SV,
"TL" => IbanEx.Country.TL,
"TR" => IbanEx.Country.TR,
"UA" => IbanEx.Country.UA,
"VA" => IbanEx.Country.VA
"VA" => IbanEx.Country.VA,
"VG" => IbanEx.Country.VG,
"XK" => IbanEx.Country.XK
}
@supported_country_codes Map.keys(@supported_countries)
@@ -57,7 +89,7 @@ def supported_country_codes(), do: @supported_country_codes
@spec supported_country_modules() :: [module()] | []
def supported_country_modules(), do: @supported_country_modules
@spec country_module(country_code) :: Module.t() | error_tuple()
@spec country_module(country_code) :: module() | error_tuple()
def country_module(country_code) when is_binary(country_code) or is_atom(country_code) do
normalized_country_code = normalize(country_code)
case is_country_code_supported?(normalized_country_code) do