Skip to content

Commit

Permalink
fix: update supported countries, and fix count not being updated (cau…
Browse files Browse the repository at this point in the history
…sed by: ee9771b)
  • Loading branch information
skwasjer committed Oct 5, 2024
1 parent 43faf64 commit 96dd0e3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
6 changes: 4 additions & 2 deletions SupportedCountries.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

*In mid 2022, an IBAN pattern for the Russian Federation (RU) was registered with SWIFT. This project has not (yet) adopted support for this pattern due to the war in Ukraine.*

# IbanNet supports 124 countries
# IbanNet supports 126 countries

## SWIFT registry

Expand Down Expand Up @@ -71,10 +71,11 @@ See the [SWIFT website](https://www.swift.com/standards/data-standards/iban-inte
| NI | Nicaragua | 28 | `NI45 BAPR 0000 0013 0000 0355 8124` | No | ![Supported][supported] | - |
| NL | Netherlands (The) | 18 | `NL91 ABNA 0417 1643 00` | Yes | ![Supported][supported] | - |
| NO | Norway | 15 | `NO93 8601 1117 947` | Yes | ![Supported][supported] | - |
| OM | Oman | 23 | `OM81 0180 0000 0129 9123 456` | No | ![Supported][supported] | - |
| PK | Pakistan | 24 | `PK36 SCBL 0000 0011 2345 6702` | No | ![Supported][supported] | - |
| PL | Poland | 28 | `PL61 1090 1014 0000 0712 1981 2874` | Yes | - | ![Supported][supported] |
| PS | Palestine, State of | 29 | `PS92 PALS 0000 0000 0400 1234 5670 2` | No | ![Supported][supported] | - |
| PT | Portugal | 25 | `PT50 0002 0123 1234 5678 9015 4` | Yes | ![Supported][supported] | - |
| PT | Portugal | 25 | `PT50 0002 0123 1234 5678 9015 4` | Yes | ![Supported][supported] | ![Supported][supported] |
| QA | Qatar | 29 | `QA58 DOHB 0000 1234 5678 90AB CDEF G` | No | ![Supported][supported] | - |
| RO | Romania | 24 | `RO49 AAAA 1B31 0075 9384 0000` | Yes | ![Supported][supported] | - |
| RS | Serbia | 22 | `RS35 2600 0560 1001 6113 79` | No | ![Supported][supported] | - |
Expand All @@ -95,6 +96,7 @@ See the [SWIFT website](https://www.swift.com/standards/data-standards/iban-inte
| VA | Vatican City State | 22 | `VA59 0011 2300 0012 3456 78` | Yes | ![Supported][supported] | - |
| VG | Virgin Islands | 24 | `VG96 VPVG 0000 0123 4567 8901` | No | ![Supported][supported] | - |
| XK | Kosovo | 20 | `XK05 1212 0123 4567 8906` | No | ![Supported][supported] | ![Supported][supported] |
| YE | Yemen | 30 | `YE15 CBYE 0001 0188 6123 4567 8912 34` | No | ![Supported][supported] | ![Supported][supported] |

### Finland includes:

Expand Down
10 changes: 4 additions & 6 deletions SupportedCountries.tt
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
Providers = { swiftProvider, wikiProvider }
};
var parser = new IbanParser(registry);
var supportedCount = registry.Count;
var supportedCount = registry.Count + registry.Sum(x => x.IncludedCountries.Count);

var comparer = new IbanCountryCodeComparer();
var filteredWikiCountries = wikiProvider.Except(swiftProvider, comparer).OrderBy(c => c.TwoLetterISORegionName);
Expand All @@ -34,15 +34,15 @@

*In mid 2022, an IBAN pattern for the Russian Federation (RU) was registered with SWIFT. This project has not (yet) adopted support for this pattern due to the war in Ukraine.*

# IbanNet supports 124 countries
# IbanNet supports <#= supportedCount #> countries

## SWIFT registry

See the [SWIFT website](https://www.swift.com/standards/data-standards/iban-international-bank-account-number) for more information.

<# RenderTable(swiftProvider, parser); #>

<# RenderIncludedCountries(swiftProvider, ref supportedCount); #>
<# RenderIncludedCountries(swiftProvider); #>

## Wikipedia

Expand Down Expand Up @@ -91,7 +91,7 @@ private void RenderTable(IEnumerable<IbanCountry> countries, IIbanParser parser)
}
}

private void RenderIncludedCountries(IIbanRegistryProvider provider, ref int supportedCount)
private void RenderIncludedCountries(IIbanRegistryProvider provider)
{
var overrideCountryDescription = new Dictionary<string, string>
{
Expand All @@ -102,8 +102,6 @@ private void RenderIncludedCountries(IIbanRegistryProvider provider, ref int sup
{
if (country.IncludedCountries.Count > 0)
{
supportedCount += country.IncludedCountries.Count;

WriteLine($"### {country.EnglishName} includes:");
WriteLine("");

Expand Down

0 comments on commit 96dd0e3

Please sign in to comment.