feat: Add emitEvent step + cleanup (#7643)

* feat: Add emitEvent step + cleanup

* fix typo

* fix typo
This commit is contained in:
Adrien de Peretti
2024-06-07 11:52:19 +02:00
committed by GitHub
parent 3cd2d60daa
commit 2e77a076b8
19 changed files with 178 additions and 117 deletions

View File

@@ -1,50 +1,49 @@
import {} from "@models"
import {
Modules,
CommonEvents,
PricingEvents,
eventBuilderFactory,
Modules,
PricingEvents,
} from "@medusajs/utils"
export const eventBuilders = {
createdPriceSet: eventBuilderFactory({
service: Modules.PRICING,
source: Modules.PRICING,
action: CommonEvents.CREATED,
object: "price_set",
eventsEnum: PricingEvents,
}),
createdPriceSetRuleType: eventBuilderFactory({
service: Modules.PRICING,
source: Modules.PRICING,
action: CommonEvents.CREATED,
object: "price_set_rule_type",
eventsEnum: PricingEvents,
}),
createdPrice: eventBuilderFactory({
service: Modules.PRICING,
source: Modules.PRICING,
action: CommonEvents.CREATED,
object: "price",
eventsEnum: PricingEvents,
}),
createdPriceRule: eventBuilderFactory({
service: Modules.PRICING,
source: Modules.PRICING,
action: CommonEvents.CREATED,
object: "price_rule",
eventsEnum: PricingEvents,
}),
createdPriceList: eventBuilderFactory({
service: Modules.PRICING,
source: Modules.PRICING,
action: CommonEvents.CREATED,
object: "price_list",
eventsEnum: PricingEvents,
}),
createdPriceListRule: eventBuilderFactory({
service: Modules.PRICING,
source: Modules.PRICING,
action: CommonEvents.CREATED,
object: "price_list_rule",
eventsEnum: PricingEvents,
}),
attachedPriceListRule: eventBuilderFactory({
service: Modules.PRICING,
source: Modules.PRICING,
action: CommonEvents.ATTACHED,
object: "price_list_rule",
eventsEnum: PricingEvents,