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

Add Orders client and use it to get orders info #125

Merged
merged 1 commit into from
Sep 19, 2023

Conversation

enzomerca
Copy link
Contributor

What problem is this solving?

Use Orders endpoint instead of OMS endpoint to obtain order information. The new Orders endpoint returns the correct orderGroup (unlike the OMS endpoint) and this orderGroup is used to generate a new order when clicking on the "Order Again" button.

Ultimately this PR is fixing the KI: "Order Again from B2B Orders History doesn't work".

How to test it?

  1. Make an order
  2. Go to "My Account" -> "Orders"
  3. Click on "Order again" button for the order you just created. It should create a new cart with the same items.

Workspace

Screenshots or example usage:

8EC6DDBE-60AB-405A-9C65-5F0CC9C6C4E2

Describe alternatives you've considered, if any.

@enzomerca enzomerca requested a review from a team September 14, 2023 14:15
@vtex-io-ci-cd
Copy link

vtex-io-ci-cd bot commented Sep 14, 2023

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:

  • Patch (backwards-compatible bug fixes)

  • Minor (backwards-compatible functionality)

  • Major (incompatible API changes)

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

  • No thanks, I would rather do it manually 😞

@vtex-io-docs-bot
Copy link

vtex-io-docs-bot bot commented Sep 14, 2023

Beep boop 🤖

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

  • There's nothing new to document 🤔
  • I'll do it later 😞

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

  • I just updated 🎉🎉

@github-actions
Copy link

Messages
📖 ❤️ Thanks!
📖

🎉 PR additions = 79, PR deletions = 27

Generated by 🚫 dangerJS against f9dcc78

@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

0.0% 0.0% Coverage
0.0% 0.0% Duplication

warning The version of Java (11.0.17) you have used to run this analysis is deprecated and we will stop accepting it soon. Please update to at least Java 17.
Read more here

Copy link
Contributor

@mairatma mairatma left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code lgtm, the only concern I have here is any differences between the two endpoints, like a missing field on the endpoint we're going to use now. How sure are we that they're compatible for the use cases here?

@enzomerca
Copy link
Contributor Author

enzomerca commented Sep 18, 2023

Code lgtm, the only concern I have here is any differences between the two endpoints, like a missing field on the endpoint we're going to use now. How sure are we that they're compatible for the use cases here?

So, I compared the 2 endpoints here: https://vtex-dev.atlassian.net/browse/B2BTEAM-1376
And theoretically we are handling the only problematic difference between the 2 endpoints (the marketplaceItems field that can return null instead of []).

But yeah, is hard to say 100% that nothing will break. We don't really know if some array field that returns data in our tests, can return [] in some other use case but the new API will return null and break something. To avoid that we would need to do the same thing that we did for marketplaceItems (check if it is null, and if it is, set to []) for all other array fields in the response.

What do you think?

PS: I talked to order-management team and they suggested this approach for now (I can give more details offline)

@mairatma
Copy link
Contributor

PS: I talked to order-management team and they suggested this approach for now (I can give more details offline)

I was going to suggest talking to them, but you already did! Lgtm, then!

@enzomerca enzomerca merged commit c2a4190 into master Sep 19, 2023
10 checks passed
@vtex-io-ci-cd
Copy link

vtex-io-ci-cd bot commented Sep 19, 2023

Your PR has been merged! App is being published. 🚀
Version 0.36.0 → 0.36.1

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 [email protected]

After that your app will be updated on all accounts.

For more information on the deployment process check the docs. 📖

@enzomerca enzomerca deleted the fix/B2BTEAM-1187-use-orders-endpoint branch September 19, 2023 13:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants