Abstract
Abstract base class for all domain events.
Provides common functionality for domain events including automatic timestamp generation. Extend this class to create specific event types.
type ArticleCreatedPayload = { title: string; url: string };class ArticleCreatedEvent extends BaseDomainEvent<ArticleCreatedPayload> { constructor(data: { title: string; url: string; userId: string; caller: string }) { super( "article.created", { title: data.title, url: data.url }, { caller: data.caller, userId: data.userId } ); }} Copy
type ArticleCreatedPayload = { title: string; url: string };class ArticleCreatedEvent extends BaseDomainEvent<ArticleCreatedPayload> { constructor(data: { title: string; url: string; userId: string; caller: string }) { super( "article.created", { title: data.title, url: data.url }, { caller: data.caller, userId: data.userId } ); }}
DomainEvent for the interface
The type of the event payload
Creates a new domain event.
The type identifier for the event
Event-specific data
Contextual information (timestamp is auto-generated)
Readonly
The type of event (e.g., "article.created")
Contextual information about the event
Abstract base class for all domain events.
Remarks
Provides common functionality for domain events including automatic timestamp generation. Extend this class to create specific event types.
Example
See
DomainEvent for the interface