Skip to content

Commit

Permalink
Add currency code SLE/925 to IsoCurrency (closes #89)
Browse files Browse the repository at this point in the history
This currency code was introduced by ISO-4217 amendment number 171 and is effective from 1 April 2022.
  • Loading branch information
marcwrobel committed Apr 20, 2022
1 parent 112f7ab commit be2005c
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 4 deletions.
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
31 changes: 31 additions & 0 deletions src/main/java/fr/marcwrobel/jbanking/IsoCurrency.java
Original file line number Diff line number Diff line change
Expand Up @@ -895,6 +895,37 @@ public enum IsoCurrency {
*/
HNL(340, 2, HN),

/**
* Sierra Leonean leone.
*
* <p>This currency code was introduced by ISO-4217 amendment number 171 and is effective from 1
* April 2022 :
*
* <blockquote>
*
* 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.
*
* <p>During this transition period, both the old Leone and new Leone will be in physical
* circulation for at least 90 days.
*
* <p>The Bank of Sierra Leone will adopt the new code in the local system but SLL/694 shall
* remain in use until further notice.
*
* </blockquote>
*
* @see <a href="https://wikipedia.org/wiki/Venezuelan_bol%C3%ADvar">wikipedia.org</a>
* @see <a
* href="https://www.currency-iso.org/dam/downloads/dl_currency_iso_amendment_171.pdf">ISO-4217
* amendment number 171</a>
* @see <a href="https://wikipedia.org/wiki/Sierra_Leonean_leone">wikipedia.org</a>
* @since 3.2.0
*/
SLE(925, 2, SL),

/**
* Sierra Leonean leone.
*
Expand Down
9 changes: 5 additions & 4 deletions src/test/java/fr/marcwrobel/jbanking/IsoCurrencyTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@
*/
class IsoCurrencyTest {

private static final Set<String> NOT_IN_NV_I18N =
new HashSet<>(Arrays.asList("UYW", "VED", "SLE"));

@Test
void fromAlphaCodeAllowsNull() {
assertFalse(fromAlphabeticCode(null).isPresent());
Expand Down Expand Up @@ -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());
Expand Down Expand Up @@ -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());
Expand Down

0 comments on commit be2005c

Please sign in to comment.