import { DomainEvent } from '../../../Shared/domain/DomainEvent' ; export class CoursesCounterIncrementedDomainEvent extends DomainEvent { static readonly EVENT_NAME = 'courses_counter.incremented' ; readonly total : number ; constructor ( data ) { super ( CoursesCounterIncrementedDomainEvent . EVENT_NAME , data . aggregateId , data . eventId , data . occurredOn ) ; this . total = data . total ; } toPrimitive ( ) { return { total : this . total , eventName : CoursesCounterIncrementedDomainEvent . EVENT_NAME } ; } static fromPrimitives ( aggregateId , body , eventId , occurredOn ) { return new CoursesCounterIncrementedDomainEvent ( { aggregateId , total : body . total , eventId , occurredOn } ) ; } }