import { Timestamp } from '@centsideas/types' ; import { IDomainEvent , DomainEvent } from '@centsideas/event-sourcing' ; import { IdeaEventNames } from '@centsideas/enums' ; import { IdeaModels } from '@centsideas/models' ; @ DomainEvent ( IdeaEventNames . Published ) export class IdeaPublished implements IDomainEvent { constructor ( public readonly publishedAt ) { } serialize ( ) { return { publishedAt : this . publishedAt . toString ( ) , } ; } static deserialize ( { publishedAt } ) { return new IdeaPublished ( Timestamp . fromString ( publishedAt ) ) ; } }