import { AggregateRoot } from '@nestjs/cqrs' ; import { ProductWasAddedEvent } from '../events/product-was-added.event' ; export class ProductAggregate extends AggregateRoot { constructor ( private readonly sku ) { super ( ) ; } public registerProduct ( sku , name , price , currency ) { this . apply ( new ProductWasAddedEvent ( sku , name , price , currency ) ) ; } }