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,medusa,types,utils): add rules to promotion endpoints + workflow #6692

Merged
merged 4 commits into from
Mar 13, 2024

Conversation

riqwan
Copy link
Contributor

@riqwan riqwan commented Mar 13, 2024

what:

  • adds endpoint + workflow to add rules to a promotion
    • promotion rules
    • application target rules
    • application buy rules
  • updates promotion module:
    • add*Rules to return created PromotionRules instead of Promotion
    • remove*Rules return void similar to other remove methods

Copy link

changeset-bot bot commented Mar 13, 2024

🦋 Changeset detected

Latest commit: b0f1e6c

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

This PR includes changesets to release 5 packages
Name Type
@medusajs/core-flows Patch
@medusajs/medusa Patch
@medusajs/types Patch
@medusajs/utils Patch
@medusajs/promotion 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 Mar 13, 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 Mar 13, 2024 6:42pm
3 Ignored Deployments
Name Status Preview Comments Updated (UTC)
api-reference ⬜️ Ignored (Inspect) Mar 13, 2024 6:42pm
docs-ui ⬜️ Ignored (Inspect) Visit Preview Mar 13, 2024 6:42pm
medusa-docs ⬜️ Ignored (Inspect) Visit Preview Mar 13, 2024 6:42pm

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, great work. Minor comments.

Can't figure out if it makes sense to squash the endpoints, but I think we'll find out when building out the admin UI for it.

import { WorkflowData, createWorkflow } from "@medusajs/workflows-sdk"
import { addRulesToPromotionsStep } from "../steps"

type WorkflowInput = {
Copy link
Contributor

Choose a reason for hiding this comment

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

todo: Move to @medusajs/types

@riqwan
Copy link
Contributor Author

riqwan commented Mar 13, 2024

@olivermrbl Same, I had an urge to do promotions/[id]/[rule_type] as well 😄

@riqwan riqwan merged commit 640eccd into develop Mar 13, 2024
18 checks passed
@riqwan riqwan deleted the feat/add-rules-to-promotion branch March 13, 2024 20:19
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