import { DomainEvent , IDomainEvent } from '@centsideas/event-sourcing' ; import { UserEventNames } from '@centsideas/enums' ; import { UserModels } from '@centsideas/models' ; import { Timestamp } from '@centsideas/types' ; @ DomainEvent ( UserEventNames . DeletionRequested ) export class UserDeletionRequested implements IDomainEvent { constructor ( public readonly requestedAt ) { } serialize ( ) { return { requestedAt : this . requestedAt . toString ( ) , } ; } static deserialize ( { requestedAt } ) { return new UserDeletionRequested ( Timestamp . fromString ( requestedAt ) ) ; } }