chore(core-flows): move cart and line item flows outside definition (#8703)
* chore(core-flows): move cart and line item flows outside definition * remove all references of definition * export cart and line items
This commit is contained in:
1 parent
83bfad386e
commit
64820cebef
65 files changed
+39
-41
No files matched your search
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
+1
-1
@@ -3,7 +3,7 @@ import {
|
||||
createWorkflow,
|
||||
transform,
|
||||
} from "@medusajs/workflows-sdk"
|
||||
import { useRemoteQueryStep } from "../../../common/steps/use-remote-query"
|
||||
import { useRemoteQueryStep } from "../../common/steps/use-remote-query"
|
||||
import {
|
||||
addShippingMethodToCartStep,
|
||||
removeShippingMethodFromCartStep,
|
||||
+1
-1
@@ -9,7 +9,7 @@ import {
|
||||
parallelize,
|
||||
transform,
|
||||
} from "@medusajs/workflows-sdk"
|
||||
import { useRemoteQueryStep } from "../../../common/steps/use-remote-query"
|
||||
import { useRemoteQueryStep } from "../../common/steps/use-remote-query"
|
||||
import {
|
||||
createLineItemsStep,
|
||||
getLineItemActionsStep,
|
||||
+3
-3
@@ -11,9 +11,9 @@ import {
|
||||
createRemoteLinkStep,
|
||||
emitEventStep,
|
||||
useRemoteQueryStep,
|
||||
} from "../../../common"
|
||||
import { createOrdersStep } from "../../../order/steps/create-orders"
|
||||
import { authorizePaymentSessionStep } from "../../../payment/steps/authorize-payment-session"
|
||||
} from "../../common"
|
||||
import { createOrdersStep } from "../../order/steps/create-orders"
|
||||
import { authorizePaymentSessionStep } from "../../payment/steps/authorize-payment-session"
|
||||
import { validateCartPaymentsStep } from "../steps"
|
||||
import { reserveInventoryStep } from "../steps/reserve-inventory"
|
||||
import { completeCartFields } from "../utils/fields"
|
||||
File renamed without changes.
+1
-1
@@ -8,7 +8,7 @@ import {
|
||||
parallelize,
|
||||
transform,
|
||||
} from "@medusajs/workflows-sdk"
|
||||
import { useRemoteQueryStep } from "../../../common/steps/use-remote-query"
|
||||
import { useRemoteQueryStep } from "../../common/steps/use-remote-query"
|
||||
import {
|
||||
createCartsStep,
|
||||
findOneOrAnyRegionStep,
|
||||
+2
-2
@@ -9,8 +9,8 @@ import {
|
||||
createWorkflow,
|
||||
transform,
|
||||
} from "@medusajs/workflows-sdk"
|
||||
import { createRemoteLinkStep } from "../../../common/steps/create-remote-links"
|
||||
import { useRemoteQueryStep } from "../../../common/steps/use-remote-query"
|
||||
import { createRemoteLinkStep } from "../../common/steps/create-remote-links"
|
||||
import { useRemoteQueryStep } from "../../common/steps/use-remote-query"
|
||||
import { createPaymentCollectionsStep } from "../steps/create-payment-collection"
|
||||
|
||||
/**
|
||||
File renamed without changes.
+1
-1
@@ -6,7 +6,7 @@ import {
|
||||
WorkflowData,
|
||||
WorkflowResponse,
|
||||
} from "@medusajs/workflows-sdk"
|
||||
import { useRemoteQueryStep } from "../../../common/steps/use-remote-query"
|
||||
import { useRemoteQueryStep } from "../../common/steps/use-remote-query"
|
||||
|
||||
export const listShippingOptionsForCartWorkflowId =
|
||||
"list-shipping-options-for-cart"
|
||||
+3
-3
@@ -6,9 +6,9 @@ import {
|
||||
transform,
|
||||
when,
|
||||
} from "@medusajs/workflows-sdk"
|
||||
import { useRemoteQueryStep } from "../../../common/steps/use-remote-query"
|
||||
import { updatePaymentCollectionStep } from "../../../payment-collection"
|
||||
import { deletePaymentSessionsWorkflow } from "../../../payment-collection/workflows/delete-payment-sessions"
|
||||
import { useRemoteQueryStep } from "../../common/steps/use-remote-query"
|
||||
import { updatePaymentCollectionStep } from "../../payment-collection"
|
||||
import { deletePaymentSessionsWorkflow } from "../../payment-collection/workflows/delete-payment-sessions"
|
||||
|
||||
export type RefreshPaymentCollectionForCartWorklowInput = {
|
||||
cart_id: string
|
||||
+1
-1
@@ -4,7 +4,7 @@ import {
|
||||
createWorkflow,
|
||||
parallelize,
|
||||
} from "@medusajs/workflows-sdk"
|
||||
import { useRemoteQueryStep } from "../../../common"
|
||||
import { useRemoteQueryStep } from "../../common"
|
||||
import {
|
||||
createLineItemAdjustmentsStep,
|
||||
createShippingMethodAdjustmentsStep,
|
||||
+1
-1
@@ -8,7 +8,7 @@ import {
|
||||
parallelize,
|
||||
transform,
|
||||
} from "@medusajs/workflows-sdk"
|
||||
import { useRemoteQueryStep } from "../../../common"
|
||||
import { useRemoteQueryStep } from "../../common"
|
||||
import {
|
||||
findOneOrAnyRegionStep,
|
||||
findOrCreateCustomerStep,
|
||||
+1
-1
@@ -5,7 +5,7 @@ import {
|
||||
createWorkflow,
|
||||
transform,
|
||||
} from "@medusajs/workflows-sdk"
|
||||
import { useRemoteQueryStep } from "../../../common/steps/use-remote-query"
|
||||
import { useRemoteQueryStep } from "../../common/steps/use-remote-query"
|
||||
import { updateLineItemsStepWithSelector } from "../../line-item/steps"
|
||||
import { refreshCartShippingMethodsStep } from "../steps"
|
||||
import { validateVariantPricesStep } from "../steps/validate-variant-prices"
|
||||
File renamed without changes.
@@ -1,3 +0,0 @@
|
||||
export * from "../payment-collection"
|
||||
export * from "./cart"
|
||||
export * from "./line-item"
|
||||
@@ -1,14 +1,15 @@
|
||||
export * from "./api-key"
|
||||
export * from "./auth"
|
||||
export * from "./cart"
|
||||
export * from "./common"
|
||||
export * from "./customer"
|
||||
export * from "./customer-group"
|
||||
export * from "./defaults"
|
||||
export * from "./definition"
|
||||
export * from "./file"
|
||||
export * from "./fulfillment"
|
||||
export * from "./inventory"
|
||||
export * from "./invite"
|
||||
export * from "./line-item"
|
||||
export * from "./order"
|
||||
export * from "./payment"
|
||||
export * from "./payment-collection"
|
||||
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -8,13 +8,13 @@ import {
|
||||
transform,
|
||||
} from "@medusajs/workflows-sdk"
|
||||
import { useRemoteQueryStep } from "../../common"
|
||||
import { findOneOrAnyRegionStep } from "../../definition/cart/steps/find-one-or-any-region"
|
||||
import { findOrCreateCustomerStep } from "../../definition/cart/steps/find-or-create-customer"
|
||||
import { findSalesChannelStep } from "../../definition/cart/steps/find-sales-channel"
|
||||
import { getVariantPriceSetsStep } from "../../definition/cart/steps/get-variant-price-sets"
|
||||
import { validateVariantPricesStep } from "../../definition/cart/steps/validate-variant-prices"
|
||||
import { prepareLineItemData } from "../../definition/cart/utils/prepare-line-item-data"
|
||||
import { confirmVariantInventoryWorkflow } from "../../definition/cart/workflows/confirm-variant-inventory"
|
||||
import { findOneOrAnyRegionStep } from "../../cart/steps/find-one-or-any-region"
|
||||
import { findOrCreateCustomerStep } from "../../cart/steps/find-or-create-customer"
|
||||
import { findSalesChannelStep } from "../../cart/steps/find-sales-channel"
|
||||
import { getVariantPriceSetsStep } from "../../cart/steps/get-variant-price-sets"
|
||||
import { validateVariantPricesStep } from "../../cart/steps/validate-variant-prices"
|
||||
import { prepareLineItemData } from "../../cart/utils/prepare-line-item-data"
|
||||
import { confirmVariantInventoryWorkflow } from "../../cart/workflows/confirm-variant-inventory"
|
||||
import { createOrderLineItemsStep } from "../steps"
|
||||
import { productVariantsFields } from "../utils/fields"
|
||||
import { prepareCustomLineItemData } from "../utils/prepare-custom-line-item-data"
|
||||
|
||||
@@ -21,8 +21,8 @@ import {
|
||||
when,
|
||||
} from "@medusajs/workflows-sdk"
|
||||
import { createRemoteLinkStep, useRemoteQueryStep } from "../../../common"
|
||||
import { reserveInventoryStep } from "../../../definition/cart/steps/reserve-inventory"
|
||||
import { prepareConfirmInventoryInput } from "../../../definition/cart/utils/prepare-confirm-inventory-input"
|
||||
import { reserveInventoryStep } from "../../../cart/steps/reserve-inventory"
|
||||
import { prepareConfirmInventoryInput } from "../../../cart/utils/prepare-confirm-inventory-input"
|
||||
import { createReturnFulfillmentWorkflow } from "../../../fulfillment/workflows/create-return-fulfillment"
|
||||
import { previewOrderChangeStep, updateReturnsStep } from "../../steps"
|
||||
import { createOrderClaimItemsFromActionsStep } from "../../steps/claim/create-claim-items-from-actions"
|
||||
|
||||
@@ -6,7 +6,7 @@ import {
|
||||
transform,
|
||||
} from "@medusajs/workflows-sdk"
|
||||
import { createRemoteLinkStep, useRemoteQueryStep } from "../../common"
|
||||
import { createPaymentCollectionsStep } from "../../definition"
|
||||
import { createPaymentCollectionsStep } from "../../cart"
|
||||
|
||||
export const createOrderPaymentCollectionWorkflowId =
|
||||
"create-order-payment-collection"
|
||||
|
||||
@@ -9,13 +9,13 @@ import {
|
||||
transform,
|
||||
} from "@medusajs/workflows-sdk"
|
||||
import { useRemoteQueryStep } from "../../common"
|
||||
import { findOneOrAnyRegionStep } from "../../definition/cart/steps/find-one-or-any-region"
|
||||
import { findOrCreateCustomerStep } from "../../definition/cart/steps/find-or-create-customer"
|
||||
import { findSalesChannelStep } from "../../definition/cart/steps/find-sales-channel"
|
||||
import { getVariantPriceSetsStep } from "../../definition/cart/steps/get-variant-price-sets"
|
||||
import { validateVariantPricesStep } from "../../definition/cart/steps/validate-variant-prices"
|
||||
import { prepareLineItemData } from "../../definition/cart/utils/prepare-line-item-data"
|
||||
import { confirmVariantInventoryWorkflow } from "../../definition/cart/workflows/confirm-variant-inventory"
|
||||
import { findOneOrAnyRegionStep } from "../../cart/steps/find-one-or-any-region"
|
||||
import { findOrCreateCustomerStep } from "../../cart/steps/find-or-create-customer"
|
||||
import { findSalesChannelStep } from "../../cart/steps/find-sales-channel"
|
||||
import { getVariantPriceSetsStep } from "../../cart/steps/get-variant-price-sets"
|
||||
import { validateVariantPricesStep } from "../../cart/steps/validate-variant-prices"
|
||||
import { prepareLineItemData } from "../../cart/utils/prepare-line-item-data"
|
||||
import { confirmVariantInventoryWorkflow } from "../../cart/workflows/confirm-variant-inventory"
|
||||
import { createOrdersStep } from "../steps"
|
||||
import { productVariantsFields } from "../utils/fields"
|
||||
import { prepareCustomLineItemData } from "../utils/prepare-custom-line-item-data"
|
||||
|
||||
@@ -21,8 +21,8 @@ import {
|
||||
when,
|
||||
} from "@medusajs/workflows-sdk"
|
||||
import { createRemoteLinkStep, useRemoteQueryStep } from "../../../common"
|
||||
import { reserveInventoryStep } from "../../../definition/cart/steps/reserve-inventory"
|
||||
import { prepareConfirmInventoryInput } from "../../../definition/cart/utils/prepare-confirm-inventory-input"
|
||||
import { reserveInventoryStep } from "../../../cart/steps/reserve-inventory"
|
||||
import { prepareConfirmInventoryInput } from "../../../cart/utils/prepare-confirm-inventory-input"
|
||||
import { createReturnFulfillmentWorkflow } from "../../../fulfillment/workflows/create-return-fulfillment"
|
||||
import { previewOrderChangeStep, updateReturnsStep } from "../../steps"
|
||||
import { confirmOrderChanges } from "../../steps/confirm-order-changes"
|
||||
|
||||
@@ -7,11 +7,11 @@ import {
|
||||
createWorkflow,
|
||||
} from "@medusajs/workflows-sdk"
|
||||
import { useRemoteQueryStep } from "../../common"
|
||||
import { createPaymentSessionsWorkflow } from "../../definition"
|
||||
import {
|
||||
authorizePaymentSessionStep,
|
||||
capturePaymentWorkflow,
|
||||
} from "../../payment"
|
||||
import { createPaymentSessionsWorkflow } from "../../payment-collection"
|
||||
|
||||
/**
|
||||
* This step validates that the payment collection is not_paid
|
||||
|
||||
+2
-2
@@ -12,8 +12,8 @@ import {
|
||||
transform,
|
||||
} from "@medusajs/workflows-sdk"
|
||||
import { useRemoteQueryStep } from "../../../common"
|
||||
import { reserveInventoryStep } from "../../../definition/cart/steps/reserve-inventory"
|
||||
import { prepareConfirmInventoryInput } from "../../../definition/cart/utils/prepare-confirm-inventory-input"
|
||||
import { reserveInventoryStep } from "../../../cart/steps/reserve-inventory"
|
||||
import { prepareConfirmInventoryInput } from "../../../cart/utils/prepare-confirm-inventory-input"
|
||||
import { previewOrderChangeStep } from "../../steps"
|
||||
import { confirmOrderChanges } from "../../steps/confirm-order-changes"
|
||||
import {
|
||||
|
||||
Reference in new issue
Block a user