Skip to content

Commit

Permalink
feat(core): Introduce new ProductVariantPriceEvent
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelbromley committed Feb 9, 2024
1 parent 5ad41bf commit aa4eeb8
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
29 changes: 29 additions & 0 deletions packages/core/src/event-bus/events/product-variant-price-event.ts
Original file line number Diff line number Diff line change
@@ -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);
}
}
1 change: 1 addition & 0 deletions packages/core/src/event-bus/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down

0 comments on commit aa4eeb8

Please sign in to comment.