Promotion Rules Remover (steps/remove-rules-from-promotions.ts)

medusa · packages/core/core-flows/src/promotion/steps/remove-rules-from-promotions.ts · typescript · MIT
crm, automation, payments, tag:promotions, tag:rules, tag:medusajs

Removes rules from promotions in MedusaJS. Use when managing promotion rules dynamically.

// Source: https://github.com/medusajs/medusa | License: MIT | Copyright 2021 Medusajs
// Provided via justclaw.it.com; keep this notice with the code.
import {
  CreatePromotionRuleDTO,
  IPromotionModuleService,
  PromotionRuleDTO,
  RemovePromotionRulesWorkflowDTO,
} from "@medusajs/framework/types"
import { Modules, RuleType } from "@medusajs/framework/utils"
import { StepResponse, createStep } from "@medusajs/framework/workflows-sdk"

export const removeRulesFromPromotionsStepId = "remove-rules-from-promotions"
/**
 * This step removes rules from a promotion.
 * 
 * @example
 * const data = removeRulesFromPromotionsStep({
 *   rule_type: RuleType.RULES,
 *   data: {
 *     id: "promo_123",
 *     rule_ids: ["prule_123"]
 *   }
 * })
 */
export const removeRulesFromPromotionsStep = cre

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key