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, dashboard, fulfillment, fulfillment-manual, utils, types): create shipping options with calculated prices #10495

Merged
merged 17 commits into from
Dec 11, 2024

Conversation

fPolic
Copy link
Contributor

@fPolic fPolic commented Dec 8, 2024

What

  • support creating SO with calculated price
  • support updating SO for both types of pricing
  • update validateShippingOptionPricesStep to handle both SO price_types
  • add the validateShippingOptionsForPriceCalculation method to FulfillementModule
  • add canCalculate and calculatePrice to fulfillment provider service service / interface / manual provider
  • disable SO pricing edit on Admin if SO price type is calculated

CLOSES CMRC-776

Copy link

vercel bot commented Dec 8, 2024

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 Dec 11, 2024 8:19am
6 Skipped Deployments
Name Status Preview Comments Updated (UTC)
api-reference ⬜️ Ignored (Inspect) Dec 11, 2024 8:19am
api-reference-v2 ⬜️ Ignored (Inspect) Visit Preview Dec 11, 2024 8:19am
docs-ui ⬜️ Ignored (Inspect) Visit Preview Dec 11, 2024 8:19am
docs-v2 ⬜️ Ignored (Inspect) Visit Preview Dec 11, 2024 8:19am
medusa-docs ⬜️ Ignored (Inspect) Visit Preview Dec 11, 2024 8:19am
resources-docs ⬜️ Ignored (Inspect) Visit Preview Dec 11, 2024 8:19am

Copy link

changeset-bot bot commented Dec 8, 2024

⚠️ No Changeset found

Latest commit: bb3667c

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

@fPolic fPolic changed the title feat(fulfillment, core-flows, types): create shipping options with calculated prices feat(core-flows, fulfillment, fulfillment-manual, utils, types): create shipping options with calculated prices Dec 8, 2024
@fPolic fPolic changed the title feat(core-flows, fulfillment, fulfillment-manual, utils, types): create shipping options with calculated prices feat(core-flows, dashboard, fulfillment, fulfillment-manual, utils, types): create shipping options with calculated prices Dec 9, 2024
* For calculated pricing we create an "empty" price set
* so we can have simpler update flow for both cases and allow updating price_type.
*/
const prices = (option as any).prices ?? []
Copy link
Contributor Author

@fPolic fPolic Dec 9, 2024

Choose a reason for hiding this comment

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

comment: we always create associated price set for a shipping option, both calculated and flat rate, to make the implementation of create and update flows simpler and more unified (e.g. we don't have to duplicate the logic of price set creation in the update flow if the option price type changes to "flat rate")

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.

Overall LGTM

@kodiakhq kodiakhq bot merged commit d8a92db into develop Dec 11, 2024
23 checks passed
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