-
-
Notifications
You must be signed in to change notification settings - Fork 102
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Removing currencies #93
Comments
Hi @solodkiy! One of the aims of this library is to stay up to date with the official ISO currency list, and unfortunately this typically translates to breaking changes, and require a version bump (which will be even more of a problem once this library reaches I'm not sure how to best handle this: one way to mitigate this would be to add legacy currencies to the ISO currency provider (and as such, keep ZWL and SLL in the present case), but there would still be BC breaks for country-to-default-currency.
There is an ongoing discussion in #30. I still think that having a global configuration—something like As it stands, I think that implementing your own currency provider and injecting it via your DI container is the way to go, although I understand that it's easier to do If you have better suggestions, I'm happy to hear them! |
In particular, could you please share your opinion on #30 (comment)? |
Hi @BenMorel, I'm currently working at a fintech company where we're building a portfolio management system for our clients. The point raised by @solodkiy is quite relevant, and we’ve had to account for similar cases in our own system. For example, some of our clients hold long-term government bonds that were originally issued in Deutsche Mark (DEM). When calculating their current value, since the bonds are still active and interest is being paid, we encountered issues due to the currency switch. While the current value is in euros, the nominal value, which remains important to display, was issued in a now-obsolete currency. Ultimately, it seems like a matter of defining the scope of the library. Do you want it to support only current, active currencies, or should it also accommodate historical currencies—going back to a reasonable point in modern economic history? I believe the latter would offer greater reliability for enterprise-level projects. |
Hi @tigitz, thanks for your feedback! I totally agree that it doesn't hurt to include historical currencies, as long as they don't conflict with current ones (I doubt ISO would allow this anyway). I should be able to easily reconstruct the history of past currencies from the initial release of brick/money, however going farther than that would require to go backwards through the official list of ISO 4217 amendments, which is quite some work. Unless there is another trustable source somewhere? That leaves us with the country-to-currency conversion. Maybe we should just make it clear after the 1.0 release that
Looking forward to your opinion on this as well, @tigitz. Historical ISO currencies are not the only issue, people also ask for easy crypto support. |
I think it's reliable to use these sources. They provide two lists for both current and historical currencies:
We could set up a CI job to fetch these regularly and generate corresponding PHP files with all the currencies, automatically suggesting a PR when there are updates.
In line with how SIX distinguishes between
Yeah I'll definitely do because I’ve already explored it and identified two reasonable solutions IMO. |
Hi! I notice in last update that some currencies have been removed from support (ZWL, SLL).
I wonder is it correct way to handle?
For example some people could have applications which store transactions in these currencies. I understand that now there are replacements, but old transactions stay the same. If application tries load this old transactions by money 'of' construct it will fail.
And even more: the only way to do update to this lib version in this scenario will be rewrite All 'of' constructors through the code to add this codes as custom currencies. Because we don't have a way to declare default currency provider.
The text was updated successfully, but these errors were encountered: