import { IDomainEvent , DomainEvent } from '@centsideas/event-sourcing' ; import { IdeaEventNames } from '@centsideas/enums' ; import { IdeaModels } from '@centsideas/models' ; import { IdeaDescription } from './idea-description' ; @ DomainEvent ( IdeaEventNames . DescriptionEdited ) export class IdeaDescriptionEdited implements IDomainEvent { constructor ( public readonly description ) { } serialize ( ) { return { description : this . description . toString ( ) , } ; } static deserialize ( { description } ) { return new IdeaDescriptionEdited ( IdeaDescription . fromString ( description ) ) ; } }