|
1
|
import { EventBusTypes } from "@medusajs/framework/types" |
|
2
|
|
|
3
|
export function buildExpectedEventMessageShape(options: { |
|
4
|
eventName: string |
|
5
|
action: string |
|
6
|
object: string |
|
7
|
eventGroupId?: string |
|
8
|
data: any |
|
9
|
options?: Record<string, unknown> |
|
10
|
}): EventBusTypes.Message { |
|
11
|
return { |
|
12
|
name: options.eventName, |
|
13
|
metadata: { |
|
14
|
action: options.action, |
|
15
|
eventGroupId: options.eventGroupId, |
|
16
|
source: "fulfillment", |
|
17
|
object: options.object, |
|
18
|
}, |
|
19
|
data: options.data, |
|
20
|
options: options.options, |
|
21
|
} |
|
22
|
} |