Files
medusa-store/packages/modules/fulfillment/integration-tests/__fixtures__/events.ts
Harminder Virk f579f0b3be feat: restructure events payload (#8143)
* refactor: restructure events payload

Breaking change: This PR changes the event payload accepted by the event
listeners

* refactor: fix failing tests and implement feedback

* add integration tests

* fix timeout

---------

Co-authored-by: Adrien de Peretti <adrien.deperetti@gmail.com>
2024-07-16 17:09:16 +01:00

23 lines
515 B
TypeScript

import { EventBusTypes } from "@medusajs/types"
export function buildExpectedEventMessageShape(options: {
eventName: string
action: string
object: string
eventGroupId?: string
data: any
options?: Record<string, unknown>
}): EventBusTypes.Message {
return {
name: options.eventName,
metadata: {
action: options.action,
eventGroupId: options.eventGroupId,
source: "fulfillment",
object: options.object,
},
data: options.data,
options: options.options,
}
}