Base interface for Domain Events in Domain-Driven Design.

Domain Events represent something that happened in the domain that domain experts care about. They are immutable facts about the past.

interface UserCreatedEvent extends DomainEvent {
readonly userId: string;
readonly email: string;
}

const event: UserCreatedEvent = {
occurredAt: new Date(),
userId: '123',
email: 'user@example.com'
};
interface DomainEvent {
    occurredAt: Date;
}

Hierarchy (View Summary)

Properties

Properties

occurredAt: Date

The timestamp when this event occurred.