Files
medusa-store/packages/modules/fulfillment/integration-tests/__fixtures__/events.ts
Riqwan Thamir 39ddba2491 chore: ability to group events on redis event bus (#7655)
* chore: ability to group events on redis event bus

* chore: fix tests

* Update packages/modules/event-bus-redis/src/services/event-bus-redis.ts

Co-authored-by: Adrien de Peretti <adrien.deperetti@gmail.com>

* chore: change shape of input and body data

* chore: fix builds

* chore: address comments

* chore: fix unit test

---------

Co-authored-by: Adrien de Peretti <adrien.deperetti@gmail.com>
2024-06-10 22:15:43 +02:00

23 lines
520 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 {
eventName: options.eventName,
metadata: {
action: options.action,
eventGroupId: options.eventGroupId,
source: "fulfillment",
object: options.object,
},
data: options.data,
options: options.options,
}
}