fix(core-flows,utils): move fulfillment workflow events (#12338)
Move fulfillment workflow events to be with other workflow events. Could be considered a breaking change for users using the previously `FulfillmentEvents` variable
This commit is contained in:
1 parent
2bfe936185
commit
a53d645f8a
5 files changed
+41
-4
No files matched your search
@@ -0,0 +1,6 @@
|
|||||||
|
---
|
||||||
|
"@medusajs/core-flows": patch
|
||||||
|
"@medusajs/utils": patch
|
||||||
|
---
|
||||||
|
|
||||||
|
fix(core-flows,utils): move fulfillment workflow events
|
||||||
@@ -8,7 +8,7 @@ import {
|
|||||||
OrderWorkflow,
|
OrderWorkflow,
|
||||||
ProductVariantDTO,
|
ProductVariantDTO,
|
||||||
} from "@medusajs/framework/types"
|
} from "@medusajs/framework/types"
|
||||||
import { FulfillmentEvents, MathBN, Modules } from "@medusajs/framework/utils"
|
import { FulfillmentWorkflowEvents, MathBN, Modules } from "@medusajs/framework/utils"
|
||||||
import {
|
import {
|
||||||
WorkflowData,
|
WorkflowData,
|
||||||
WorkflowResponse,
|
WorkflowResponse,
|
||||||
@@ -243,7 +243,7 @@ export const createOrderShipmentWorkflow = createWorkflow(
|
|||||||
)
|
)
|
||||||
|
|
||||||
emitEventStep({
|
emitEventStep({
|
||||||
eventName: FulfillmentEvents.SHIPMENT_CREATED,
|
eventName: FulfillmentWorkflowEvents.SHIPMENT_CREATED,
|
||||||
data: { id: shipment.id, no_notification: input.no_notification },
|
data: { id: shipment.id, no_notification: input.no_notification },
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import {
|
|||||||
ProductVariantDTO,
|
ProductVariantDTO,
|
||||||
RegisterOrderDeliveryDTO,
|
RegisterOrderDeliveryDTO,
|
||||||
} from "@medusajs/framework/types"
|
} from "@medusajs/framework/types"
|
||||||
import { FulfillmentEvents, MathBN, Modules } from "@medusajs/framework/utils"
|
import { FulfillmentWorkflowEvents, MathBN, Modules } from "@medusajs/framework/utils"
|
||||||
import {
|
import {
|
||||||
WorkflowData,
|
WorkflowData,
|
||||||
WorkflowResponse,
|
WorkflowResponse,
|
||||||
@@ -261,7 +261,7 @@ export const markOrderFulfillmentAsDeliveredWorkflow = createWorkflow(
|
|||||||
)
|
)
|
||||||
|
|
||||||
emitEventStep({
|
emitEventStep({
|
||||||
eventName: FulfillmentEvents.DELIVERY_CREATED,
|
eventName: FulfillmentWorkflowEvents.DELIVERY_CREATED,
|
||||||
data: { id: deliveredFulfillment.id },
|
data: { id: deliveredFulfillment.id },
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@@ -107,3 +107,28 @@ export const RegionWorkflowEvents = {
|
|||||||
CREATED: "region.created",
|
CREATED: "region.created",
|
||||||
DELETED: "region.deleted",
|
DELETED: "region.deleted",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @category Fulfillment
|
||||||
|
*/
|
||||||
|
export const FulfillmentWorkflowEvents = {
|
||||||
|
/**
|
||||||
|
* Emitted when a shipment is created for an order.
|
||||||
|
*
|
||||||
|
* @eventPayload
|
||||||
|
* {
|
||||||
|
* id, // the ID of the shipment
|
||||||
|
* no_notification, // whether to notify the customer
|
||||||
|
* }
|
||||||
|
*/
|
||||||
|
SHIPMENT_CREATED: "shipment.created",
|
||||||
|
/**
|
||||||
|
* Emitted when a fulfillment is marked as delivered.
|
||||||
|
*
|
||||||
|
* @eventPayload
|
||||||
|
* {
|
||||||
|
* id, // the ID of the fulfillment
|
||||||
|
* }
|
||||||
|
*/
|
||||||
|
DELIVERY_CREATED: "delivery.created",
|
||||||
|
}
|
||||||
@@ -29,6 +29,12 @@ const eventBaseNames: [
|
|||||||
|
|
||||||
export const FulfillmentEvents = {
|
export const FulfillmentEvents = {
|
||||||
...buildEventNamesFromEntityName(eventBaseNames, Modules.FULFILLMENT),
|
...buildEventNamesFromEntityName(eventBaseNames, Modules.FULFILLMENT),
|
||||||
|
/**
|
||||||
|
* @deprecated use `FulfillmentWorkflowEvents.SHIPMENT_CREATED` instead
|
||||||
|
*/
|
||||||
SHIPMENT_CREATED: "shipment.created",
|
SHIPMENT_CREATED: "shipment.created",
|
||||||
|
/**
|
||||||
|
* @deprecated use `FulfillmentWorkflowEvents.DELIVERY_CREATED` instead
|
||||||
|
*/
|
||||||
DELIVERY_CREATED: "delivery.created",
|
DELIVERY_CREATED: "delivery.created",
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user