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(utils,types): added item/shipping adjustments for order/items/shipping_methods #6050

Merged
merged 16 commits into from
Jan 12, 2024

Conversation

riqwan
Copy link
Contributor

@riqwan riqwan commented Jan 10, 2024

what:

  • adds compute actions for the following cases:
    • items => each & across
    • shipping_method => each & across
    • order
  • adds a remove compute actions when code is no longer present in adjustments array

RESOLVES CORE-1625
RESOLVES CORE-1626
RESOLVES CORE-1627
RESOLVES CORE-1628
RESOLVES CORE-1585

Copy link

changeset-bot bot commented Jan 10, 2024

🦋 Changeset detected

Latest commit: 82b71aa

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@medusajs/types Patch
@medusajs/utils Patch

Not sure what this means? Click here to learn what changesets are.

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

Copy link

vercel bot commented Jan 10, 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 Jan 12, 2024 0:39am
3 Ignored Deployments
Name Status Preview Comments Updated (UTC)
api-reference ⬜️ Ignored (Inspect) Visit Preview Jan 12, 2024 0:39am
docs-ui ⬜️ Ignored (Inspect) Visit Preview Jan 12, 2024 0:39am
medusa-docs ⬜️ Ignored (Inspect) Visit Preview Jan 12, 2024 0:39am

@riqwan
Copy link
Contributor Author

riqwan commented Jan 11, 2024

@olivermrbl this one is ready for review

@riqwan
Copy link
Contributor Author

riqwan commented Jan 12, 2024

@adrien2p @olivermrbl can you guys prioritize this review for today? A pile is beginning atm.

@adrien2p
Copy link
Member

Yes sure, ill do that 👌

packages/promotion/src/services/promotion-module.ts Outdated Show resolved Hide resolved
packages/promotion/src/services/promotion-module.ts Outdated Show resolved Hide resolved
packages/promotion/src/utils/compute-actions/items.ts Outdated Show resolved Hide resolved
packages/promotion/src/utils/compute-actions/items.ts Outdated Show resolved Hide resolved
packages/promotion/src/utils/compute-actions/order.ts Outdated Show resolved Hide resolved
packages/types/src/promotion/service.ts Outdated Show resolved Hide resolved
packages/utils/src/common/pick-from-object.ts Outdated Show resolved Hide resolved
@adrien2p
Copy link
Member

Strong work man 💪 just a few comments and suggestions and small todo's

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.

Really strong work @riqwan 🔥

packages/types/src/promotion/service.ts Outdated Show resolved Hide resolved
packages/promotion/src/services/promotion-module.ts Outdated Show resolved Hide resolved
packages/promotion/src/services/promotion-module.ts Outdated Show resolved Hide resolved
if (!itemApplicationContext) {
throw new MedusaError(
MedusaError.Types.INVALID_DATA,
`"items" not found in context`
Copy link
Contributor

Choose a reason for hiding this comment

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

suggestion: Make error message more specific to method. items and context are props that will be used across all modules

@riqwan
Copy link
Contributor Author

riqwan commented Jan 12, 2024

@olivermrbl @adrien2p made the changes!

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

if (!itemApplicationContext) {
throw new MedusaError(
MedusaError.Types.INVALID_DATA,
`"items" should be present as an array in the context for computeActions`
Copy link
Contributor

Choose a reason for hiding this comment

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

❤️

Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com>
@kodiakhq kodiakhq bot merged commit b782d3b into develop Jan 12, 2024
16 checks passed
@github-actions github-actions bot mentioned this pull request Jan 12, 2024
@riqwan riqwan deleted the feat/compute-actions branch January 12, 2024 13:14
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.

3 participants