From be2005c6768c090459a35f61d851001e73aa1cfa Mon Sep 17 00:00:00 2001 From: Marc Wrobel Date: Wed, 20 Apr 2022 17:28:23 +0200 Subject: [PATCH] Add currency code SLE/925 to IsoCurrency (closes #89) This currency code was introduced by ISO-4217 amendment number 171 and is effective from 1 April 2022. --- CHANGELOG.md | 15 +++++++++ .../fr/marcwrobel/jbanking/IsoCurrency.java | 31 +++++++++++++++++++ .../marcwrobel/jbanking/IsoCurrencyTest.java | 9 +++--- 3 files changed, 51 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index eb714cc..105e1f8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,21 @@ This new release… > > The actual currency code VES/928 remains the valid code after 1 October 2021 to use in any future > transactions to indicate the redenominated Bolívar Soberano. + - Add currency code SLE/925 to `IsoCurrency` (#89). This currency code was introduced by + [ISO-4217 amendment number 171](https://www.currency-iso.org/dam/downloads/dl_currency_iso_amendment_171.pdf) and is + effective from 1 April 2022. According to the amendment : + > The Sierra Leonean LEONE (SLL) is redenominated by removing three (3) zeros from the denominations. A new currency + > code SLE/925 representing the new valuation (1’000 times old SLL/694) is introduced on 1 st April 2022 for any + > internal needs during the redenomination process, and is replacing SLL as the official currency code, after the + > transition period to be determined. + > + > During this transition period, both the old Leone and new Leone will be in physical circulation for at least 90 + > days. + > + > The Bank of Sierra Leone will adopt the new code in the local system but SLL/694 shall remain in use until further + > notice. + > + > The Sierra Leonean currency shall continue to be the LEONE and this will not change after redenomination. ### Changed diff --git a/src/main/java/fr/marcwrobel/jbanking/IsoCurrency.java b/src/main/java/fr/marcwrobel/jbanking/IsoCurrency.java index fbe5782..fa8ee52 100644 --- a/src/main/java/fr/marcwrobel/jbanking/IsoCurrency.java +++ b/src/main/java/fr/marcwrobel/jbanking/IsoCurrency.java @@ -895,6 +895,37 @@ public enum IsoCurrency { */ HNL(340, 2, HN), + /** + * Sierra Leonean leone. + * + *

This currency code was introduced by ISO-4217 amendment number 171 and is effective from 1 + * April 2022 : + * + *

+ * + * The Sierra Leonean LEONE (SLL) is redenominated by removing three (3) zeros from the + * denominations. A new currency code SLE/925 representing the new valuation (1’000 times old + * SLL/694) is introduced on 1 st April 2022 for any internal needs during the redenomination + * process, and is replacing SLL as the official currency code, after the transition period to be + * determined. + * + *

During this transition period, both the old Leone and new Leone will be in physical + * circulation for at least 90 days. + * + *

The Bank of Sierra Leone will adopt the new code in the local system but SLL/694 shall + * remain in use until further notice. + * + *

+ * + * @see wikipedia.org + * @see ISO-4217 + * amendment number 171 + * @see wikipedia.org + * @since 3.2.0 + */ + SLE(925, 2, SL), + /** * Sierra Leonean leone. * diff --git a/src/test/java/fr/marcwrobel/jbanking/IsoCurrencyTest.java b/src/test/java/fr/marcwrobel/jbanking/IsoCurrencyTest.java index d304044..f57f182 100644 --- a/src/test/java/fr/marcwrobel/jbanking/IsoCurrencyTest.java +++ b/src/test/java/fr/marcwrobel/jbanking/IsoCurrencyTest.java @@ -27,6 +27,9 @@ */ class IsoCurrencyTest { + private static final Set NOT_IN_NV_I18N = + new HashSet<>(Arrays.asList("UYW", "VED", "SLE")); + @Test void fromAlphaCodeAllowsNull() { assertFalse(fromAlphabeticCode(null).isPresent()); @@ -130,8 +133,7 @@ void ensureCountriesCompleteness() { stream(IsoCurrency.values()) .filter( isoCurrency -> - !Arrays.asList("UYW", "VED") - .contains(isoCurrency.getAlphabeticCode())) // not in nv-i18n + !NOT_IN_NV_I18N.contains(isoCurrency.getAlphabeticCode())) // not in nv-i18n .forEach( currency -> { CurrencyCode currencyCode = CurrencyCode.getByCode(currency.getAlphabeticCode()); @@ -164,8 +166,7 @@ void ensureNoDeprecated() { isoCurrency -> !isoCurrency.getAlphabeticCode().equals("CLF")) // wrong minor unit .filter( isoCurrency -> - !Arrays.asList("UYW", "VED") - .contains(isoCurrency.getAlphabeticCode())) // not in nv-i18n + !NOT_IN_NV_I18N.contains(isoCurrency.getAlphabeticCode())) // not in nv-i18n .filter( currency -> { CurrencyCode code = CurrencyCode.getByCode(currency.getAlphabeticCode());