Skip to content

Commit

Permalink
#145 - Add support for MA (Morocco) and reorder (countries starting w…
Browse files Browse the repository at this point in the history
…ith M* subsection) list in alphabetical order. (#146)

* #145 - Add support for MA and reorder list in alphabetical order.

#145 - Add support for MA and reorder list in alphabetical order.

* Add test data
  • Loading branch information
marius-cornescu authored Jul 23, 2024
1 parent 910bb6b commit 60fd728
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 28 deletions.
63 changes: 35 additions & 28 deletions src/main/java/org/iban4j/bban/BbanStructure.java
Original file line number Diff line number Diff line change
Expand Up @@ -333,55 +333,62 @@ public class BbanStructure {
new BbanStructure(
BbanStructureEntry.bankCode(3, 'n'), BbanStructureEntry.accountNumber(13, 'c')));

structures.put(
CountryCode.MA,
new BbanStructure(
BbanStructureEntry.bankCode(3, 'n'),
BbanStructureEntry.branchCode(5, 'n'),
BbanStructureEntry.accountNumber(16, 'n')));

structures.put(
CountryCode.MC,
new BbanStructure(
BbanStructureEntry.bankCode(5, 'n'),
BbanStructureEntry.branchCode(5, 'n'),
BbanStructureEntry.accountNumber(11, 'c'),
BbanStructureEntry.nationalCheckDigit(2, 'n')));

structures.put(
CountryCode.MD,
new BbanStructure(
BbanStructureEntry.bankCode(2, 'c'), BbanStructureEntry.accountNumber(18, 'c')));

structures.put(
CountryCode.ME,
new BbanStructure(
BbanStructureEntry.bankCode(3, 'n'),
BbanStructureEntry.accountNumber(13, 'n'),
BbanStructureEntry.nationalCheckDigit(2, 'n')));

structures.put(
CountryCode.MK,
new BbanStructure(
BbanStructureEntry.bankCode(3, 'n'),
BbanStructureEntry.accountNumber(10, 'c'),
BbanStructureEntry.nationalCheckDigit(2, 'n')));

structures.put(
CountryCode.MR,
new BbanStructure(
BbanStructureEntry.bankCode(5, 'n'),
BbanStructureEntry.branchCode(5, 'n'),
BbanStructureEntry.accountNumber(11, 'n'),
BbanStructureEntry.nationalCheckDigit(2, 'n')));

structures.put(
CountryCode.MT,
new BbanStructure(
BbanStructureEntry.bankCode(4, 'a'),
BbanStructureEntry.branchCode(5, 'n'),
BbanStructureEntry.accountNumber(18, 'c')));

structures.put(
CountryCode.MR,
new BbanStructure(
BbanStructureEntry.bankCode(5, 'n'),
BbanStructureEntry.branchCode(5, 'n'),
BbanStructureEntry.accountNumber(11, 'n'),
BbanStructureEntry.nationalCheckDigit(2, 'n')));

structures.put(
CountryCode.MU,
new BbanStructure(
BbanStructureEntry.bankCode(6, 'c'),
BbanStructureEntry.branchCode(2, 'n'),
BbanStructureEntry.accountNumber(18, 'c')));

structures.put(
CountryCode.MD,
new BbanStructure(
BbanStructureEntry.bankCode(2, 'c'), BbanStructureEntry.accountNumber(18, 'c')));

structures.put(
CountryCode.MC,
new BbanStructure(
BbanStructureEntry.bankCode(5, 'n'),
BbanStructureEntry.branchCode(5, 'n'),
BbanStructureEntry.accountNumber(11, 'c'),
BbanStructureEntry.nationalCheckDigit(2, 'n')));

structures.put(
CountryCode.ME,
new BbanStructure(
BbanStructureEntry.bankCode(3, 'n'),
BbanStructureEntry.accountNumber(13, 'n'),
BbanStructureEntry.nationalCheckDigit(2, 'n')));

structures.put(
CountryCode.NL,
new BbanStructure(
Expand Down
9 changes: 9 additions & 0 deletions src/test/java/org/iban4j/TestDataHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -417,6 +417,15 @@ public static Collection<Object[]> getIbanData() {
.build(),
"LU280019400644750000"
},
{
new Iban.Builder()
.countryCode(CountryCode.MA)
.bankCode("011")
.branchCode("51900")
.accountNumber("0001205000534921")
.build(),
"MA64011519000001205000534921"
},
{
new Iban.Builder()
.countryCode(CountryCode.MF)
Expand Down

0 comments on commit 60fd728

Please sign in to comment.