vtex-apps / store-graphql

GraphQL schema and resolvers for the VTEX Commerce Stores API
78 stars 45 forks source link

change price logic #649

Closed beatrizmaselli closed 1 year ago

beatrizmaselli commented 1 year ago

What problem is this solving?

When we have a multiplier unit involved in some situations the price returned by the IS was divergent. For example:

Price: 430 Unit multiplier: 1,3 discount: -19 Selling Price: 540

IS calculation before = Selling Price/(Unit multiplier 100) = 4.15 So using this price to calculate the Selling Price would result in = 4.15 1.3 = 5.395 (truncating the number 5.39) ❌

Now with the new calculation we get:

Price = 4.16 Calculating Selling Price = 4.16 * 1.3 = 5.409 ((truncating the number 5.40) 👌

How to test it?

Beta version: vtex.store-graphql@2.161.5-beta2

You can use the implemented test calculatePrice to perform different tests.

image image

How does this PR make you feel? :link:

vtex-io-ci-cd[bot] commented 1 year ago

Hi! I'm VTEX IO CI/CD Bot and I'll be helping you to publish your app! 🤖

Please select which version do you want to release:

And then you just need to merge your PR when you are ready! There is no need to create a release commit/tag.

vtex-io-docs-bot[bot] commented 1 year ago

Beep boop :robot:

I noticed you didn't make any changes at the docs/ folder

In order to keep track, I'll create an issue if you decide now is not a good time

vtex-io-ci-cd[bot] commented 1 year ago

Your PR has been merged! App is being published. :rocket: Version 2.165.0 → 2.166.0

After the publishing process has been completed (check #vtex-io-releases) and doing A/B tests with the new version, you can deploy your release by running:

vtex deploy vtex.store-graphql@2.166.0

After that your app will be updated on all accounts.

For more information on the deployment process check the docs. :book: