16 lines
348 B
TypeScript
16 lines
348 B
TypeScript
import { v4 as uuidv4 } from 'uuid';
|
|
|
|
export abstract class DomainEvent {
|
|
public readonly eventId: string;
|
|
public readonly occurredAt: Date;
|
|
|
|
constructor() {
|
|
this.eventId = uuidv4();
|
|
this.occurredAt = new Date();
|
|
}
|
|
|
|
abstract get eventType(): string;
|
|
abstract get aggregateId(): string;
|
|
abstract get aggregateType(): string;
|
|
}
|