implement events to the pricing module (#7584)

This commit is contained in:
Harminder Virk
2024-06-05 17:33:49 +05:30
committed by GitHub
parent b2f2c366ec
commit 2b62686ec6
8 changed files with 435 additions and 17 deletions

View 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,
}),
}

View File

@@ -1 +1,2 @@
export * from "./validate-price-list-dates"
export * from "./events"