UNPKG

@medusajs/core-flows

Version:

Set of workflow definitions for Medusa

73 lines 3.18 kB
import { AdditionalData, PromotionStatusValues } from "@medusajs/framework/types"; /** * The data to update the status of one or more promotions. */ export type UpdatePromotionsStatusWorkflowInput = { /** * The promotions to update their status. */ promotionsData: { /** * The ID of the promotion. */ id: string; /** * The new status of the promotion. */ status: PromotionStatusValues; }[]; } & AdditionalData; export declare const updatePromotionsValidationStep: import("@medusajs/framework/workflows-sdk").StepFunction<UpdatePromotionsStatusWorkflowInput, unknown>; export declare const updatePromotionsStatusWorkflowId = "update-promotions-status"; /** * This workflow updates the status of one or more promotions. * * This workflow has a hook that allows you to perform custom actions on the updated promotions. For example, you can pass under `additional_data` custom data that * allows you to create custom data models linked to the promotions. * * You can also use this workflow within your customizations or your own custom workflows, allowing you to * update the status of promotions within your custom flows. * * @example * const { result } = await updatePromotionsStatusWorkflow(container) * .run({ * input: { * promotionsData: { * id: "promo_123", * status: "active" * }, * additional_data: { * external_id: "ext_123" * } * } * }) * * @summary * * Update the status of one or more promotions. * * @property hooks.promotionStatusUpdated - This hook is executed after the promotions' status is updated. You can consume this hook to perform custom actions on the updated promotions. */ export declare const updatePromotionsStatusWorkflow: import("@medusajs/framework/workflows-sdk").ReturnWorkflow<{ /** * The promotions to update their status. */ promotionsData: { /** * The ID of the promotion. */ id: string; /** * The new status of the promotion. */ status: PromotionStatusValues; }[]; } & AdditionalData, import("@medusajs/framework/types").PromotionDTO[], [import("@medusajs/framework/workflows-sdk").Hook<"promotionStatusUpdated", { promotions: (import("@medusajs/framework/types").PromotionDTO | import("@medusajs/framework/workflows-sdk").WorkflowData<import("@medusajs/framework/types").PromotionDTO>)[] & import("@medusajs/framework/types").PromotionDTO[] & import("@medusajs/framework/workflows-sdk").WorkflowDataProperties<import("@medusajs/framework/types").PromotionDTO[]> & { config(config: { name?: string; } & Omit<import("@medusajs/orchestration").TransactionStepsDefinition, "next" | "uuid" | "action">): import("@medusajs/framework/workflows-sdk").WorkflowData<import("@medusajs/framework/types").PromotionDTO[]>; } & import("@medusajs/framework/workflows-sdk").StepFunctionReturnConfig<import("@medusajs/framework/types").PromotionDTO[]>; additional_data: Record<string, unknown> | undefined; }, unknown>]>; //# sourceMappingURL=update-promotions-status.d.ts.map