14 lines
348 B
TypeScript
14 lines
348 B
TypeScript
export interface DomainEvent<T = unknown> {
|
|
readonly eventType: string;
|
|
readonly aggregateId: string;
|
|
readonly eventData: T;
|
|
readonly occurredAt: Date;
|
|
}
|
|
|
|
export interface DomainEventPublisher {
|
|
publish(event: DomainEvent): Promise<void>;
|
|
}
|
|
|
|
// Alias for backward compatibility
|
|
export type DomainEventAlias<T = unknown> = DomainEvent<T>;
|