Skip to content
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

Re-evaluate storing the monetary amounts including the currency #380

Open
odrotbohm opened this issue Dec 6, 2021 · 0 comments
Open

Re-evaluate storing the monetary amounts including the currency #380

odrotbohm opened this issue Dec 6, 2021 · 0 comments
Labels
lifecycle: feedback requested Information missing module: core Core / Time / Quantity / Payment

Comments

@odrotbohm
Copy link
Member

We currently store MonetaryAmount values as String in the database and include the currency with it. This causes the sorting to break as the values are compared lexically rather than numerically. We essentially have two options:

  1. Assume Euro as the only currency to be used with Salespoint – that would allow us to simply store the amount value and thus the database schema to change to a numeric value so that ordering works again. Downside of this: we'd rule out Salespoint to be used with multiple currencies. We could make the one currency to be used configurable, though.
  2. Use better database mapping – We currently use JPA AttributeConverter implementations to store the MonetaryAmount values. Another option would be a Hibernate user type that supports mapping a value to multiple columns. That still raises the question of how that would behave in terms of ordering, as a mixture of currencies wouldn't sort properly without knowing the exchange rates.
@odrotbohm odrotbohm added lifecycle: feedback requested Information missing module: core Core / Time / Quantity / Payment labels Dec 6, 2021
@odrotbohm odrotbohm added this to the 7.5 milestone Dec 6, 2021
@odrotbohm odrotbohm removed this from the 7.5 milestone Sep 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lifecycle: feedback requested Information missing module: core Core / Time / Quantity / Payment
Projects
None yet
Development

No branches or pull requests

1 participant