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

feat(core-flows): cart complete shipping validate #10984

Merged
merged 11 commits into from
Feb 4, 2025

Conversation

fPolic
Copy link
Contributor

@fPolic fPolic commented Jan 15, 2025

What

  • validate that there is a shipping method if any of the line items have requires_shipping=true
  • validate that products shipping profile is supported by a shipping method on the cart
  • update tests

CLOSES CMRC-683

@fPolic fPolic requested a review from a team as a code owner January 15, 2025 19:25
@fPolic fPolic requested review from adrien2p, carlos-r-l-rodrigues and kasperkristensen and removed request for a team January 15, 2025 19:25
Copy link

vercel bot commented Jan 15, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
medusa-dashboard ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 3, 2025 9:10am
6 Skipped Deployments
Name Status Preview Comments Updated (UTC)
api-reference ⬜️ Ignored (Inspect) Feb 3, 2025 9:10am
api-reference-v2 ⬜️ Ignored (Inspect) Visit Preview Feb 3, 2025 9:10am
docs-ui ⬜️ Ignored (Inspect) Visit Preview Feb 3, 2025 9:10am
docs-v2 ⬜️ Ignored (Inspect) Visit Preview Feb 3, 2025 9:10am
medusa-docs ⬜️ Ignored (Inspect) Visit Preview Feb 3, 2025 9:10am
resources-docs ⬜️ Ignored (Inspect) Visit Preview Feb 3, 2025 9:10am

Copy link

changeset-bot bot commented Jan 15, 2025

⚠️ No Changeset found

Latest commit: e29abce

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link
Contributor

@olivermrbl olivermrbl left a comment

Choose a reason for hiding this comment

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

LGTM, nice

Copy link
Contributor

@olivermrbl olivermrbl left a comment

Choose a reason for hiding this comment

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

LGTM

@fPolic fPolic force-pushed the feat/cart-complete-shipping-validate branch from b31a556 to 223ac2b Compare January 27, 2025 12:15
@fPolic fPolic requested a review from a team as a code owner January 27, 2025 12:15
@fPolic fPolic changed the base branch from feat/product-shipping-profile-link to develop January 27, 2025 12:15
@@ -932,6 +932,7 @@ medusaIntegrationTestRunner({
.post(
`/admin/orders/${order.id}/fulfillments`,
{
shipping_option_id: seeder.shippingOption.id, // shipping option with the "regular" shipping profile
Copy link
Contributor

Choose a reason for hiding this comment

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

question: This still optional at the HTTP level right? Why did we need to add this here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, it's optional. In this test, the cart has 2 shipping methods for supporting 2 different shipping profiles that products in the cart have. So when creating fulfilment here we want to specify which method is used to heave deterministic behaviour in the test (otherwise shipping_methods[0] would be used which is non determinsitic).


This test checks if shipping method for fulfilment supports shipping profile of the items that are being fulfilled but the cart previously had only one shipping method with one shipping profile and the item in cart had another profile.
This PR introduced a validation that a cart cannot be completed if there isn't a shipping method for every shipping profile in the cart so now for the order seeder to work and complete the cart we needed to modify the test so 2 methods are on the cart and needed to specify which one is used for fulfillment in this case.

@kodiakhq kodiakhq bot merged commit 462c3e8 into develop Feb 4, 2025
23 checks passed
@kodiakhq kodiakhq bot deleted the feat/cart-complete-shipping-validate branch February 4, 2025 10:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants