UNPKG

@medusajs/core-flows

Version:

Set of workflow definitions for Medusa

40 lines 1.32 kB
import { PromotionDTO } from "@medusajs/types"; export declare const validatePromoCodesToAddId = "validate-promo-codes-to-add"; /** * The details of the promo codes to add to a draft order. */ export interface ValidatePromoCodesToAddStepInput { /** * The promo codes to add to the draft order. */ promo_codes: string[]; /** * The promotions to add to the draft order. */ promotions: PromotionDTO[]; } /** * This step validates that the promo codes to add to a draft order are valid. It throws an error if the * promo codes don't exist or are inactive. * * :::note * * You can retrieve a promotion's details using [Query](https://docs.medusajs.com/learn/fundamentals/module-links/query), * or [useQueryGraphStep](https://docs.medusajs.com/resources/references/medusa-workflows/steps/useQueryGraphStep). * * ::: * * @example * const data = validatePromoCodesToAddStep({ * promo_codes: ["PROMO_123", "PROMO_456"], * promotions: [{ * id: "promo_123", * code: "PROMO_123" * }, { * id: "promo_456", * code: "PROMO_456" * }], * }) */ export declare const validatePromoCodesToAddStep: import("@medusajs/framework/workflows-sdk").StepFunction<ValidatePromoCodesToAddStepInput, unknown>; //# sourceMappingURL=validate-promo-codes-to-add.d.ts.map