UNPKG

@medusajs/core-flows

Version:

Set of workflow definitions for Medusa

79 lines 2.22 kB
import { CreatePriceSetDTO, PriceRule } from "@medusajs/framework/types"; /** * The data to create price sets for a currency code. */ export interface ShippingOptionsPriceCurrencyCode { /** * The currency code of the price. * * @example * usd */ currency_code: string; /** * The amount of the price. */ amount: number; /** * The rules of the price. */ rules?: PriceRule[]; } /** * The data to create price sets for a region ID. */ interface ShippingOptionsPriceRegionId { /** * The ID of the region that this price applies in. */ region_id: string; /** * The amount of the price. */ amount: number; /** * The rules of the price. */ rules?: PriceRule[]; } /** * The data to create price sets for shipping options. */ export type CreateShippingOptionsPriceSetsStepInput = { /** * The ID of the shipping option. */ id: string; /** * The prices to create for the shipping option. */ prices: (ShippingOptionsPriceCurrencyCode | ShippingOptionsPriceRegionId)[]; }[]; /** * The result of creating price sets for shipping options. */ export type CreateShippingOptionsPriceSetsStepOutput = { /** * The ID of the shipping option. */ id: string; /** * The ID of the price set. */ priceSetId: string; }[]; export declare function buildPriceSet(prices: CreateShippingOptionsPriceSetsStepInput[0]["prices"], regionToCurrencyMap: Map<string, string>): CreatePriceSetDTO; export declare const createShippingOptionsPriceSetsStepId = "add-shipping-options-prices-step"; /** * This step creates price sets for one or more shipping options. * * :::note * * Learn more about adding rules to the shipping option's prices in the Pricing Module's * [Price Rules](https://docs.medusajs.com/resources/commerce-modules/pricing/price-rules) documentation. * * ::: */ export declare const createShippingOptionsPriceSetsStep: import("@medusajs/framework/workflows-sdk").StepFunction<CreateShippingOptionsPriceSetsStepInput, CreateShippingOptionsPriceSetsStepOutput>; export {}; //# sourceMappingURL=add-shipping-options-prices.d.ts.map