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

DefaultMoneyStrategy's round is called instead of custom MoneyStrategy #3356

Open
Szbuli opened this issue Feb 10, 2025 · 0 comments
Open

DefaultMoneyStrategy's round is called instead of custom MoneyStrategy #3356

Szbuli opened this issue Feb 10, 2025 · 0 comments
Labels
type: bug 🐛 Something isn't working

Comments

@Szbuli
Copy link

Szbuli commented Feb 10, 2025

Describe the bug
DefaultMoneyStrategy's round is called instead of custom MoneyStrategy.

In the Vendure config, entityOptions.moneyStrategy is set to our custom MoneyStrategy implementation. The custom ColumnOptions is used by Vendure, but the round method is never called.

With the debugger I found the root cause:
https://github.com/vendure-ecommerce/vendure/blob/master/packages/core/src/common/round-money.ts#L15
When it first gets the MoneyStrategy it will still be the default vendure config, if I remove the state saving, it will work as expected, as later the getConfig returns the Vendure config given by us.

Expected behavior
Use the round method of the configured custom MoneyStrategy

Environment:

  • @vendure/core version: 3.1.2
  • Nodejs version: 20
  • Database: postgres 16
@Szbuli Szbuli added the type: bug 🐛 Something isn't working label Feb 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug 🐛 Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant