feat(core-flows, order): add workflow to create change order actions (#8056)
what: - adds workflow to create change order actions
This commit is contained in:
1 parent
04ec8e758f
commit
bec2dcd667
37 files changed
+290
-46
No files matched your search
@@ -0,0 +1,116 @@
|
|||||||
|
import {
|
||||||
|
createOrderChangeActionsWorkflow,
|
||||||
|
createOrderChangeActionsWorkflowId,
|
||||||
|
createOrderChangeWorkflow,
|
||||||
|
} from "@medusajs/core-flows"
|
||||||
|
import { IOrderModuleService, OrderChangeDTO, OrderDTO } from "@medusajs/types"
|
||||||
|
import { ChangeActionType, ModuleRegistrationName } from "@medusajs/utils"
|
||||||
|
import { medusaIntegrationTestRunner } from "medusa-test-utils"
|
||||||
|
import { createOrderFixture, prepareDataFixtures } from "./__fixtures__"
|
||||||
|
|
||||||
|
jest.setTimeout(50000)
|
||||||
|
|
||||||
|
medusaIntegrationTestRunner({
|
||||||
|
env: { MEDUSA_FF_MEDUSA_V2: true },
|
||||||
|
testSuite: ({ getContainer }) => {
|
||||||
|
let container
|
||||||
|
|
||||||
|
beforeAll(() => {
|
||||||
|
container = getContainer()
|
||||||
|
})
|
||||||
|
|
||||||
|
describe("Order change action workflows", () => {
|
||||||
|
let order: OrderDTO
|
||||||
|
let service: IOrderModuleService
|
||||||
|
let orderChange: OrderChangeDTO
|
||||||
|
|
||||||
|
describe("createOrderChangeActionWorkflow", () => {
|
||||||
|
beforeEach(async () => {
|
||||||
|
const fixtures = await prepareDataFixtures({ container })
|
||||||
|
|
||||||
|
order = await createOrderFixture({
|
||||||
|
container,
|
||||||
|
product: fixtures.product,
|
||||||
|
location: fixtures.location,
|
||||||
|
inventoryItem: fixtures.inventoryItem,
|
||||||
|
})
|
||||||
|
|
||||||
|
const { result } = await createOrderChangeWorkflow(container).run({
|
||||||
|
input: { order_id: order.id },
|
||||||
|
})
|
||||||
|
|
||||||
|
orderChange = result
|
||||||
|
service = container.resolve(ModuleRegistrationName.ORDER)
|
||||||
|
})
|
||||||
|
|
||||||
|
it("should successfully create an order change action", async () => {
|
||||||
|
const { result } = await createOrderChangeActionsWorkflow(
|
||||||
|
container
|
||||||
|
).run({
|
||||||
|
input: [
|
||||||
|
{
|
||||||
|
action: ChangeActionType.ITEM_ADD,
|
||||||
|
order_change_id: orderChange.id,
|
||||||
|
order_id: order.id,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
action: ChangeActionType.ITEM_REMOVE,
|
||||||
|
order_change_id: orderChange.id,
|
||||||
|
order_id: order.id,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
})
|
||||||
|
|
||||||
|
expect(result).toHaveLength(2)
|
||||||
|
expect(result).toEqual(
|
||||||
|
expect.arrayContaining([
|
||||||
|
expect.objectContaining({
|
||||||
|
id: expect.any(String),
|
||||||
|
order_id: order.id,
|
||||||
|
order_change_id: orderChange.id,
|
||||||
|
action: ChangeActionType.ITEM_ADD,
|
||||||
|
}),
|
||||||
|
expect.objectContaining({
|
||||||
|
id: expect.any(String),
|
||||||
|
order_id: order.id,
|
||||||
|
order_change_id: orderChange.id,
|
||||||
|
action: ChangeActionType.ITEM_REMOVE,
|
||||||
|
}),
|
||||||
|
])
|
||||||
|
)
|
||||||
|
})
|
||||||
|
|
||||||
|
it("should delete created actions when a rollback occurs on a workflow", async () => {
|
||||||
|
const workflow = createOrderChangeActionsWorkflow(container)
|
||||||
|
|
||||||
|
workflow.appendAction("throw", createOrderChangeActionsWorkflowId, {
|
||||||
|
invoke: async function failStep() {
|
||||||
|
throw new Error(`Fail`)
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
const {
|
||||||
|
errors: [error],
|
||||||
|
} = await workflow.run({
|
||||||
|
input: [
|
||||||
|
{
|
||||||
|
action: ChangeActionType.ITEM_ADD,
|
||||||
|
order_change_id: orderChange.id,
|
||||||
|
order_id: order.id,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
throwOnError: false,
|
||||||
|
})
|
||||||
|
|
||||||
|
const orderChange1 = await service.retrieveOrderChange(
|
||||||
|
orderChange.id,
|
||||||
|
{ relations: ["actions"] }
|
||||||
|
)
|
||||||
|
|
||||||
|
expect(error).toBeDefined()
|
||||||
|
expect(orderChange1.actions).toHaveLength(0)
|
||||||
|
})
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
|
})
|
||||||
@@ -0,0 +1,34 @@
|
|||||||
|
import {
|
||||||
|
CreateOrderChangeActionDTO,
|
||||||
|
IOrderModuleService,
|
||||||
|
} from "@medusajs/types"
|
||||||
|
import { ModuleRegistrationName } from "@medusajs/utils"
|
||||||
|
import { StepResponse, createStep } from "@medusajs/workflows-sdk"
|
||||||
|
|
||||||
|
export const createOrderChangeActionsStepId = "create-order-change-actions"
|
||||||
|
export const createOrderChangeActionsStep = createStep(
|
||||||
|
createOrderChangeActionsStepId,
|
||||||
|
async (data: CreateOrderChangeActionDTO[], { container }) => {
|
||||||
|
const service = container.resolve<IOrderModuleService>(
|
||||||
|
ModuleRegistrationName.ORDER
|
||||||
|
)
|
||||||
|
|
||||||
|
const created = await service.addOrderAction(data)
|
||||||
|
|
||||||
|
return new StepResponse(
|
||||||
|
created,
|
||||||
|
created.map((c) => c.id)
|
||||||
|
)
|
||||||
|
},
|
||||||
|
async (ids, { container }) => {
|
||||||
|
if (!ids?.length) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
const service = container.resolve<IOrderModuleService>(
|
||||||
|
ModuleRegistrationName.ORDER
|
||||||
|
)
|
||||||
|
|
||||||
|
await service.deleteOrderChangeActions(ids)
|
||||||
|
}
|
||||||
|
)
|
||||||
@@ -6,6 +6,7 @@ export * from "./cancel-orders"
|
|||||||
export * from "./cancel-return"
|
export * from "./cancel-return"
|
||||||
export * from "./complete-orders"
|
export * from "./complete-orders"
|
||||||
export * from "./create-order-change"
|
export * from "./create-order-change"
|
||||||
|
export * from "./create-order-change-actions"
|
||||||
export * from "./create-orders"
|
export * from "./create-orders"
|
||||||
export * from "./decline-order-change"
|
export * from "./decline-order-change"
|
||||||
export * from "./delete-order-change"
|
export * from "./delete-order-change"
|
||||||
|
|||||||
@@ -0,0 +1,16 @@
|
|||||||
|
import {
|
||||||
|
CreateOrderChangeActionDTO,
|
||||||
|
OrderChangeActionDTO,
|
||||||
|
} from "@medusajs/types"
|
||||||
|
import { WorkflowData, createWorkflow } from "@medusajs/workflows-sdk"
|
||||||
|
import { createOrderChangeActionsStep } from "../steps"
|
||||||
|
|
||||||
|
export const createOrderChangeActionsWorkflowId = "create-order-change-actions"
|
||||||
|
export const createOrderChangeActionsWorkflow = createWorkflow(
|
||||||
|
createOrderChangeActionsWorkflowId,
|
||||||
|
(
|
||||||
|
input: WorkflowData<CreateOrderChangeActionDTO[]>
|
||||||
|
): WorkflowData<OrderChangeActionDTO[]> => {
|
||||||
|
return createOrderChangeActionsStep(input)
|
||||||
|
}
|
||||||
|
)
|
||||||
@@ -6,6 +6,7 @@ export * from "./cancel-return"
|
|||||||
export * from "./complete-orders"
|
export * from "./complete-orders"
|
||||||
export * from "./create-fulfillment"
|
export * from "./create-fulfillment"
|
||||||
export * from "./create-order-change"
|
export * from "./create-order-change"
|
||||||
|
export * from "./create-order-change-actions"
|
||||||
export * from "./create-orders"
|
export * from "./create-orders"
|
||||||
export * from "./create-return"
|
export * from "./create-return"
|
||||||
export * from "./create-shipment"
|
export * from "./create-shipment"
|
||||||
|
|||||||
@@ -1544,6 +1544,42 @@ export interface IOrderModuleService extends IModuleService {
|
|||||||
sharedContext?: Context
|
sharedContext?: Context
|
||||||
): Promise<OrderChangeActionDTO[]>
|
): Promise<OrderChangeActionDTO[]>
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This method deletes {return type} by its ID.
|
||||||
|
*
|
||||||
|
* @param {string[]} actionId - The list of {summary}
|
||||||
|
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
|
||||||
|
* @returns {Promise<void>} Resolves when {summary}
|
||||||
|
*
|
||||||
|
* @example
|
||||||
|
* ```typescript
|
||||||
|
* await orderModuleService.deleteOrderActions(["12345abc", "67890def"]);
|
||||||
|
* ```
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
deleteOrderChangeActions(
|
||||||
|
actionId: string[],
|
||||||
|
sharedContext?: Context
|
||||||
|
): Promise<void>
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This method deletes {return type} by its ID.
|
||||||
|
*
|
||||||
|
* @param {string} orderId - The order action's ID.
|
||||||
|
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
|
||||||
|
* @returns {Promise<void>} Resolves when {summary}
|
||||||
|
*
|
||||||
|
* @example
|
||||||
|
* ```typescript
|
||||||
|
* await orderModuleService.deleteOrderActions("orderActionId");
|
||||||
|
* ```
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
deleteOrderChangeActions(
|
||||||
|
actionId: string,
|
||||||
|
sharedContext?: Context
|
||||||
|
): Promise<void>
|
||||||
|
|
||||||
softDeleteAddresses<TReturnableLinkableKeys extends string = string>(
|
softDeleteAddresses<TReturnableLinkableKeys extends string = string>(
|
||||||
ids: string[],
|
ids: string[],
|
||||||
config?: SoftDeleteReturn<TReturnableLinkableKeys>,
|
config?: SoftDeleteReturn<TReturnableLinkableKeys>,
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
export * from "./events"
|
export * from "./events"
|
||||||
|
export * from "./order-change-action"
|
||||||
export * from "./status"
|
export * from "./status"
|
||||||
|
|
||||||
File renamed without changes.
@@ -4,9 +4,8 @@ import {
|
|||||||
CreateOrderDTO,
|
CreateOrderDTO,
|
||||||
IOrderModuleService,
|
IOrderModuleService,
|
||||||
} from "@medusajs/types"
|
} from "@medusajs/types"
|
||||||
import { BigNumber, Modules } from "@medusajs/utils"
|
import { BigNumber, ChangeActionType, Modules } from "@medusajs/utils"
|
||||||
import { moduleIntegrationTestRunner } from "medusa-test-utils"
|
import { moduleIntegrationTestRunner } from "medusa-test-utils"
|
||||||
import { ChangeActionType } from "../../src/utils"
|
|
||||||
|
|
||||||
jest.setTimeout(100000)
|
jest.setTimeout(100000)
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
|
import { ChangeActionType } from "@medusajs/utils"
|
||||||
import { OrderChangeEvent } from "../../../../types"
|
import { OrderChangeEvent } from "../../../../types"
|
||||||
import { ChangeActionType, calculateOrderChange } from "../../../../utils"
|
import { calculateOrderChange } from "../../../../utils"
|
||||||
|
|
||||||
describe("Order Exchange - Actions", function () {
|
describe("Order Exchange - Actions", function () {
|
||||||
const originalOrder = {
|
const originalOrder = {
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
|
import { ChangeActionType } from "@medusajs/utils"
|
||||||
import { OrderChangeEvent } from "../../../../types"
|
import { OrderChangeEvent } from "../../../../types"
|
||||||
import { ChangeActionType, calculateOrderChange } from "../../../../utils"
|
import { calculateOrderChange } from "../../../../utils"
|
||||||
|
|
||||||
describe("Order Return - Actions", function () {
|
describe("Order Return - Actions", function () {
|
||||||
const originalOrder = {
|
const originalOrder = {
|
||||||
|
|||||||
@@ -3,8 +3,7 @@ import {
|
|||||||
CreateOrderChangeActionDTO,
|
CreateOrderChangeActionDTO,
|
||||||
OrderTypes,
|
OrderTypes,
|
||||||
} from "@medusajs/types"
|
} from "@medusajs/types"
|
||||||
import { promiseAll } from "@medusajs/utils"
|
import { ChangeActionType, promiseAll } from "@medusajs/utils"
|
||||||
import { ChangeActionType } from "../../utils"
|
|
||||||
|
|
||||||
async function createOrderChange(
|
async function createOrderChange(
|
||||||
service,
|
service,
|
||||||
|
|||||||
@@ -3,8 +3,7 @@ import {
|
|||||||
CreateOrderChangeActionDTO,
|
CreateOrderChangeActionDTO,
|
||||||
OrderTypes,
|
OrderTypes,
|
||||||
} from "@medusajs/types"
|
} from "@medusajs/types"
|
||||||
import { promiseAll } from "@medusajs/utils"
|
import { ChangeActionType, promiseAll } from "@medusajs/utils"
|
||||||
import { ChangeActionType } from "../../utils"
|
|
||||||
|
|
||||||
async function createOrderChange(
|
async function createOrderChange(
|
||||||
service,
|
service,
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { Context, OrderTypes } from "@medusajs/types"
|
import { Context, OrderTypes } from "@medusajs/types"
|
||||||
import { ChangeActionType } from "../../utils"
|
import { ChangeActionType } from "@medusajs/utils"
|
||||||
|
|
||||||
export async function cancelFulfillment(
|
export async function cancelFulfillment(
|
||||||
this: any,
|
this: any,
|
||||||
|
|||||||
@@ -3,8 +3,7 @@ import {
|
|||||||
CreateOrderChangeActionDTO,
|
CreateOrderChangeActionDTO,
|
||||||
OrderTypes,
|
OrderTypes,
|
||||||
} from "@medusajs/types"
|
} from "@medusajs/types"
|
||||||
import { promiseAll } from "@medusajs/utils"
|
import { ChangeActionType, promiseAll } from "@medusajs/utils"
|
||||||
import { ChangeActionType } from "../../utils"
|
|
||||||
|
|
||||||
async function createOrderChange(
|
async function createOrderChange(
|
||||||
service,
|
service,
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import {
|
|||||||
OrderTypes,
|
OrderTypes,
|
||||||
} from "@medusajs/types"
|
} from "@medusajs/types"
|
||||||
import {
|
import {
|
||||||
|
ChangeActionType,
|
||||||
ClaimType,
|
ClaimType,
|
||||||
ReturnStatus,
|
ReturnStatus,
|
||||||
getShippingMethodsTotals,
|
getShippingMethodsTotals,
|
||||||
@@ -12,7 +13,6 @@ import {
|
|||||||
} from "@medusajs/utils"
|
} from "@medusajs/utils"
|
||||||
import { ClaimItem, OrderClaim, Return, ReturnItem } from "@models"
|
import { ClaimItem, OrderClaim, Return, ReturnItem } from "@models"
|
||||||
import { OrderChangeType } from "@types"
|
import { OrderChangeType } from "@types"
|
||||||
import { ChangeActionType } from "../../utils"
|
|
||||||
|
|
||||||
function createClaimAndReturnEntities(em, data, order) {
|
function createClaimAndReturnEntities(em, data, order) {
|
||||||
const claimReference = em.create(OrderClaim, {
|
const claimReference = em.create(OrderClaim, {
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import {
|
|||||||
OrderTypes,
|
OrderTypes,
|
||||||
} from "@medusajs/types"
|
} from "@medusajs/types"
|
||||||
import {
|
import {
|
||||||
|
ChangeActionType,
|
||||||
ReturnStatus,
|
ReturnStatus,
|
||||||
getShippingMethodsTotals,
|
getShippingMethodsTotals,
|
||||||
isString,
|
isString,
|
||||||
@@ -11,7 +12,6 @@ import {
|
|||||||
} from "@medusajs/utils"
|
} from "@medusajs/utils"
|
||||||
import { ExchangeItem, OrderExchange, Return, ReturnItem } from "@models"
|
import { ExchangeItem, OrderExchange, Return, ReturnItem } from "@models"
|
||||||
import { OrderChangeType } from "@types"
|
import { OrderChangeType } from "@types"
|
||||||
import { ChangeActionType } from "../../utils"
|
|
||||||
|
|
||||||
function createExchangeAndReturnEntities(em, data, order) {
|
function createExchangeAndReturnEntities(em, data, order) {
|
||||||
const exchangeReference = em.create(OrderExchange, {
|
const exchangeReference = em.create(OrderExchange, {
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import {
|
|||||||
OrderTypes,
|
OrderTypes,
|
||||||
} from "@medusajs/types"
|
} from "@medusajs/types"
|
||||||
import {
|
import {
|
||||||
|
ChangeActionType,
|
||||||
ReturnStatus,
|
ReturnStatus,
|
||||||
getShippingMethodsTotals,
|
getShippingMethodsTotals,
|
||||||
isDefined,
|
isDefined,
|
||||||
@@ -12,7 +13,6 @@ import {
|
|||||||
} from "@medusajs/utils"
|
} from "@medusajs/utils"
|
||||||
import { Return, ReturnItem } from "@models"
|
import { Return, ReturnItem } from "@models"
|
||||||
import { OrderChangeType } from "@types"
|
import { OrderChangeType } from "@types"
|
||||||
import { ChangeActionType } from "../../utils"
|
|
||||||
|
|
||||||
function createReturnReference(em, data, order) {
|
function createReturnReference(em, data, order) {
|
||||||
return em.create(Return, {
|
return em.create(Return, {
|
||||||
|
|||||||
@@ -1,7 +1,11 @@
|
|||||||
import { Context, OrderTypes } from "@medusajs/types"
|
import { Context, OrderTypes } from "@medusajs/types"
|
||||||
import { MathBN, ReturnStatus, promiseAll } from "@medusajs/utils"
|
import {
|
||||||
|
ChangeActionType,
|
||||||
|
MathBN,
|
||||||
|
ReturnStatus,
|
||||||
|
promiseAll,
|
||||||
|
} from "@medusajs/utils"
|
||||||
import { OrderChangeType } from "@types"
|
import { OrderChangeType } from "@types"
|
||||||
import { ChangeActionType } from "../../utils"
|
|
||||||
|
|
||||||
function createReturnItems(data) {
|
function createReturnItems(data) {
|
||||||
return data.items.map((item) => ({
|
return data.items.map((item) => ({
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { Context, OrderTypes } from "@medusajs/types"
|
import { Context, OrderTypes } from "@medusajs/types"
|
||||||
import { ChangeActionType } from "../../utils"
|
import { ChangeActionType } from "@medusajs/utils"
|
||||||
|
|
||||||
export async function registerFulfillment(
|
export async function registerFulfillment(
|
||||||
this: any,
|
this: any,
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import {
|
|||||||
CreateOrderChangeActionDTO,
|
CreateOrderChangeActionDTO,
|
||||||
OrderTypes,
|
OrderTypes,
|
||||||
} from "@medusajs/types"
|
} from "@medusajs/types"
|
||||||
import { ChangeActionType } from "../../utils"
|
import { ChangeActionType } from "@medusajs/utils"
|
||||||
|
|
||||||
export async function registerShipment(
|
export async function registerShipment(
|
||||||
this: any,
|
this: any,
|
||||||
|
|||||||
@@ -2233,6 +2233,7 @@ export default class OrderModuleService<
|
|||||||
includeActions: boolean,
|
includeActions: boolean,
|
||||||
sharedContext?: Context
|
sharedContext?: Context
|
||||||
): Promise<any> {
|
): Promise<any> {
|
||||||
|
orderChangeIds = deduplicate(orderChangeIds)
|
||||||
const options = {
|
const options = {
|
||||||
select: [
|
select: [
|
||||||
"id",
|
"id",
|
||||||
|
|||||||
@@ -1,5 +1,9 @@
|
|||||||
import { MathBN, MedusaError, isDefined } from "@medusajs/utils"
|
import {
|
||||||
import { ChangeActionType } from "../action-key"
|
ChangeActionType,
|
||||||
|
MathBN,
|
||||||
|
MedusaError,
|
||||||
|
isDefined,
|
||||||
|
} from "@medusajs/utils"
|
||||||
import { OrderChangeProcessing } from "../calculate-order-change"
|
import { OrderChangeProcessing } from "../calculate-order-change"
|
||||||
import {
|
import {
|
||||||
setActionReference,
|
setActionReference,
|
||||||
|
|||||||
@@ -1,5 +1,9 @@
|
|||||||
import { MathBN, MedusaError, isDefined } from "@medusajs/utils"
|
import {
|
||||||
import { ChangeActionType } from "../action-key"
|
ChangeActionType,
|
||||||
|
MathBN,
|
||||||
|
MedusaError,
|
||||||
|
isDefined,
|
||||||
|
} from "@medusajs/utils"
|
||||||
import { OrderChangeProcessing } from "../calculate-order-change"
|
import { OrderChangeProcessing } from "../calculate-order-change"
|
||||||
import {
|
import {
|
||||||
setActionReference,
|
setActionReference,
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { ChangeActionType } from "../action-key"
|
import { ChangeActionType } from "@medusajs/utils"
|
||||||
import { OrderChangeProcessing } from "../calculate-order-change"
|
import { OrderChangeProcessing } from "../calculate-order-change"
|
||||||
|
|
||||||
OrderChangeProcessing.registerActionType(ChangeActionType.CANCEL, {
|
OrderChangeProcessing.registerActionType(ChangeActionType.CANCEL, {
|
||||||
|
|||||||
@@ -1,5 +1,9 @@
|
|||||||
import { MathBN, MedusaError, isDefined } from "@medusajs/utils"
|
import {
|
||||||
import { ChangeActionType } from "../action-key"
|
ChangeActionType,
|
||||||
|
MathBN,
|
||||||
|
MedusaError,
|
||||||
|
isDefined,
|
||||||
|
} from "@medusajs/utils"
|
||||||
import { OrderChangeProcessing } from "../calculate-order-change"
|
import { OrderChangeProcessing } from "../calculate-order-change"
|
||||||
import {
|
import {
|
||||||
setActionReference,
|
setActionReference,
|
||||||
|
|||||||
@@ -1,6 +1,10 @@
|
|||||||
import { MathBN, MedusaError, isDefined } from "@medusajs/utils"
|
import {
|
||||||
|
ChangeActionType,
|
||||||
|
MathBN,
|
||||||
|
MedusaError,
|
||||||
|
isDefined,
|
||||||
|
} from "@medusajs/utils"
|
||||||
import { VirtualOrder } from "@types"
|
import { VirtualOrder } from "@types"
|
||||||
import { ChangeActionType } from "../action-key"
|
|
||||||
import { OrderChangeProcessing } from "../calculate-order-change"
|
import { OrderChangeProcessing } from "../calculate-order-change"
|
||||||
import {
|
import {
|
||||||
setActionReference,
|
setActionReference,
|
||||||
|
|||||||
@@ -1,6 +1,10 @@
|
|||||||
import { MathBN, MedusaError, isDefined } from "@medusajs/utils"
|
import {
|
||||||
|
ChangeActionType,
|
||||||
|
MathBN,
|
||||||
|
MedusaError,
|
||||||
|
isDefined,
|
||||||
|
} from "@medusajs/utils"
|
||||||
import { VirtualOrder } from "@types"
|
import { VirtualOrder } from "@types"
|
||||||
import { ChangeActionType } from "../action-key"
|
|
||||||
import { OrderChangeProcessing } from "../calculate-order-change"
|
import { OrderChangeProcessing } from "../calculate-order-change"
|
||||||
import {
|
import {
|
||||||
setActionReference,
|
setActionReference,
|
||||||
|
|||||||
@@ -1,6 +1,10 @@
|
|||||||
import { MathBN, MedusaError, isDefined } from "@medusajs/utils"
|
import {
|
||||||
|
ChangeActionType,
|
||||||
|
MathBN,
|
||||||
|
MedusaError,
|
||||||
|
isDefined,
|
||||||
|
} from "@medusajs/utils"
|
||||||
import { EVENT_STATUS } from "@types"
|
import { EVENT_STATUS } from "@types"
|
||||||
import { ChangeActionType } from "../action-key"
|
|
||||||
import { OrderChangeProcessing } from "../calculate-order-change"
|
import { OrderChangeProcessing } from "../calculate-order-change"
|
||||||
import {
|
import {
|
||||||
setActionReference,
|
setActionReference,
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
import {
|
import {
|
||||||
|
ChangeActionType,
|
||||||
MathBN,
|
MathBN,
|
||||||
MedusaError,
|
MedusaError,
|
||||||
isDefined,
|
isDefined,
|
||||||
transformPropertiesToBigNumber,
|
transformPropertiesToBigNumber,
|
||||||
} from "@medusajs/utils"
|
} from "@medusajs/utils"
|
||||||
import { EVENT_STATUS } from "@types"
|
import { EVENT_STATUS } from "@types"
|
||||||
import { ChangeActionType } from "../action-key"
|
|
||||||
import { OrderChangeProcessing } from "../calculate-order-change"
|
import { OrderChangeProcessing } from "../calculate-order-change"
|
||||||
import {
|
import {
|
||||||
setActionReference,
|
setActionReference,
|
||||||
|
|||||||
@@ -1,5 +1,9 @@
|
|||||||
import { MathBN, MedusaError, isDefined } from "@medusajs/utils"
|
import {
|
||||||
import { ChangeActionType } from "../action-key"
|
ChangeActionType,
|
||||||
|
MathBN,
|
||||||
|
MedusaError,
|
||||||
|
isDefined,
|
||||||
|
} from "@medusajs/utils"
|
||||||
import { OrderChangeProcessing } from "../calculate-order-change"
|
import { OrderChangeProcessing } from "../calculate-order-change"
|
||||||
import {
|
import {
|
||||||
setActionReference,
|
setActionReference,
|
||||||
|
|||||||
@@ -1,5 +1,9 @@
|
|||||||
import { MathBN, MedusaError, isDefined } from "@medusajs/utils"
|
import {
|
||||||
import { ChangeActionType } from "../action-key"
|
ChangeActionType,
|
||||||
|
MathBN,
|
||||||
|
MedusaError,
|
||||||
|
isDefined,
|
||||||
|
} from "@medusajs/utils"
|
||||||
import { OrderChangeProcessing } from "../calculate-order-change"
|
import { OrderChangeProcessing } from "../calculate-order-change"
|
||||||
import {
|
import {
|
||||||
setActionReference,
|
setActionReference,
|
||||||
|
|||||||
@@ -1,5 +1,9 @@
|
|||||||
import { MathBN, MedusaError, isDefined } from "@medusajs/utils"
|
import {
|
||||||
import { ChangeActionType } from "../action-key"
|
ChangeActionType,
|
||||||
|
MathBN,
|
||||||
|
MedusaError,
|
||||||
|
isDefined,
|
||||||
|
} from "@medusajs/utils"
|
||||||
import { OrderChangeProcessing } from "../calculate-order-change"
|
import { OrderChangeProcessing } from "../calculate-order-change"
|
||||||
import {
|
import {
|
||||||
setActionReference,
|
setActionReference,
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
import { MedusaError, isDefined } from "@medusajs/utils"
|
import { ChangeActionType, MedusaError, isDefined } from "@medusajs/utils"
|
||||||
import { ChangeActionType } from "../action-key"
|
|
||||||
import { OrderChangeProcessing } from "../calculate-order-change"
|
import { OrderChangeProcessing } from "../calculate-order-change"
|
||||||
import { setActionReference } from "../set-action-reference"
|
import { setActionReference } from "../set-action-reference"
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
import { MedusaError, isDefined } from "@medusajs/utils"
|
import { ChangeActionType, MedusaError, isDefined } from "@medusajs/utils"
|
||||||
import { ChangeActionType } from "../action-key"
|
|
||||||
import { OrderChangeProcessing } from "../calculate-order-change"
|
import { OrderChangeProcessing } from "../calculate-order-change"
|
||||||
|
|
||||||
OrderChangeProcessing.registerActionType(ChangeActionType.SHIPPING_REMOVE, {
|
OrderChangeProcessing.registerActionType(ChangeActionType.SHIPPING_REMOVE, {
|
||||||
|
|||||||
@@ -1,5 +1,9 @@
|
|||||||
import { MathBN, MedusaError, isDefined } from "@medusajs/utils"
|
import {
|
||||||
import { ChangeActionType } from "../action-key"
|
ChangeActionType,
|
||||||
|
MathBN,
|
||||||
|
MedusaError,
|
||||||
|
isDefined,
|
||||||
|
} from "@medusajs/utils"
|
||||||
import { OrderChangeProcessing } from "../calculate-order-change"
|
import { OrderChangeProcessing } from "../calculate-order-change"
|
||||||
import {
|
import {
|
||||||
setActionReference,
|
setActionReference,
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
export * from "./action-key"
|
|
||||||
export * from "./actions"
|
export * from "./actions"
|
||||||
export * from "./apply-order-changes"
|
export * from "./apply-order-changes"
|
||||||
export * from "./calculate-order-change"
|
export * from "./calculate-order-change"
|
||||||
|
|||||||
Reference in new issue
Block a user