implement events to the pricing module (#7584)
This commit is contained in:
52
packages/modules/pricing/src/utils/events.ts
Normal file
52
packages/modules/pricing/src/utils/events.ts
Normal file
@@ -0,0 +1,52 @@
|
||||
import {} from "@models"
|
||||
import {
|
||||
Modules,
|
||||
CommonEvents,
|
||||
PricingEvents,
|
||||
eventBuilderFactory,
|
||||
} from "@medusajs/utils"
|
||||
|
||||
export const eventBuilders = {
|
||||
createdPriceSet: eventBuilderFactory({
|
||||
service: Modules.PRICING,
|
||||
action: CommonEvents.CREATED,
|
||||
object: "price_set",
|
||||
eventsEnum: PricingEvents,
|
||||
}),
|
||||
createdPriceSetRuleType: eventBuilderFactory({
|
||||
service: Modules.PRICING,
|
||||
action: CommonEvents.CREATED,
|
||||
object: "price_set_rule_type",
|
||||
eventsEnum: PricingEvents,
|
||||
}),
|
||||
createdPrice: eventBuilderFactory({
|
||||
service: Modules.PRICING,
|
||||
action: CommonEvents.CREATED,
|
||||
object: "price",
|
||||
eventsEnum: PricingEvents,
|
||||
}),
|
||||
createdPriceRule: eventBuilderFactory({
|
||||
service: Modules.PRICING,
|
||||
action: CommonEvents.CREATED,
|
||||
object: "price_rule",
|
||||
eventsEnum: PricingEvents,
|
||||
}),
|
||||
createdPriceList: eventBuilderFactory({
|
||||
service: Modules.PRICING,
|
||||
action: CommonEvents.CREATED,
|
||||
object: "price_list",
|
||||
eventsEnum: PricingEvents,
|
||||
}),
|
||||
createdPriceListRule: eventBuilderFactory({
|
||||
service: Modules.PRICING,
|
||||
action: CommonEvents.CREATED,
|
||||
object: "price_list_rule",
|
||||
eventsEnum: PricingEvents,
|
||||
}),
|
||||
attachedPriceListRule: eventBuilderFactory({
|
||||
service: Modules.PRICING,
|
||||
action: CommonEvents.ATTACHED,
|
||||
object: "price_list_rule",
|
||||
eventsEnum: PricingEvents,
|
||||
}),
|
||||
}
|
||||
@@ -1 +1,2 @@
|
||||
export * from "./validate-price-list-dates"
|
||||
export * from "./events"
|
||||
|
||||
Reference in New Issue
Block a user