diff --git a/packages/core/src/event-bus/events/product-variant-price-event.ts b/packages/core/src/event-bus/events/product-variant-price-event.ts new file mode 100644 index 0000000000..8e639a2803 --- /dev/null +++ b/packages/core/src/event-bus/events/product-variant-price-event.ts @@ -0,0 +1,29 @@ +import { CreateProductVariantInput, UpdateProductVariantInput } from '@vendure/common/lib/generated-types'; + +import { RequestContext } from '../../api/common/request-context'; +import { ProductVariantPrice } from '../../entity'; +import { VendureEntityEvent } from '../vendure-entity-event'; + +type ProductVariantInputTypes = undefined; + +/** + * @description + * This event is fired whenever a {@link ProductVariantPrice} is added, updated or deleted. + * + * @docsCategory events + * @docsPage Event Types + * @since 2.2.0 + */ +export class ProductVariantPriceEvent extends VendureEntityEvent< + ProductVariantPrice[], + ProductVariantInputTypes +> { + constructor( + ctx: RequestContext, + entity: ProductVariantPrice[], + type: 'created' | 'updated' | 'deleted', + input?: ProductVariantInputTypes, + ) { + super(entity, type, ctx, input); + } +} diff --git a/packages/core/src/event-bus/index.ts b/packages/core/src/event-bus/index.ts index f7239df7de..fe739c6107 100644 --- a/packages/core/src/event-bus/index.ts +++ b/packages/core/src/event-bus/index.ts @@ -45,6 +45,7 @@ export * from './events/product-option-group-change-event'; export * from './events/product-option-group-event'; export * from './events/product-variant-channel-event'; export * from './events/product-variant-event'; +export * from './events/product-variant-price-event'; export * from './events/promotion-event'; export * from './events/refund-state-transition-event'; export * from './events/role-change-event';