feat(events): Implement default priority-based event processing (#14476)
* feat(events): Set internal events default priority to lowest, default events to 100 and order placed to 10 * Create swift-months-rush.md * improvements * improvements * improvements * fix condition * doc * fix tests * fix tests --------- Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
43951ce60e
commit
7307a5e63f
@@ -6,6 +6,7 @@ import {
|
||||
UsageComputedActions,
|
||||
} from "@medusajs/framework/types"
|
||||
import {
|
||||
EventPriority,
|
||||
isDefined,
|
||||
Modules,
|
||||
OrderStatus,
|
||||
@@ -598,6 +599,9 @@ export const completeCartWorkflow = createWorkflow(
|
||||
emitEventStep({
|
||||
eventName: OrderWorkflowEvents.PLACED,
|
||||
data: { id: createdOrder.id },
|
||||
options: {
|
||||
priority: EventPriority.CRITICAL,
|
||||
},
|
||||
})
|
||||
)
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import {
|
||||
EventPriority,
|
||||
Modules,
|
||||
OrderStatus,
|
||||
OrderWorkflowEvents,
|
||||
@@ -180,6 +181,9 @@ export const convertDraftOrderWorkflow = createWorkflow(
|
||||
emitEventStep({
|
||||
eventName: OrderWorkflowEvents.PLACED,
|
||||
data: { id: updatedOrder.id },
|
||||
options: {
|
||||
priority: EventPriority.CRITICAL,
|
||||
},
|
||||
})
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user