Skip to content

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

@odrotbohm

Description

@odrotbohm

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions