interface EventicleEvent

Core event interface representing something that happened in the system.

EventicleEvent is the fundamental building block of event-driven architectures in Eventicle. Events are immutable facts about state changes that occurred, providing the foundation for event sourcing, CQRS, and saga coordination.

T - The type of the event payload data

Properties

causedById

ID of the event that caused this event (for causation tracking)

Signature
causedById?: string;

causedByType

Type of the event that caused this event

Signature
causedByType?: string;

createdAt

Event creation timestamp in milliseconds (auto-generated if not provided)

Signature
createdAt?: number;

data

The event payload containing the actual event data

Signature
data: T;

domainId

Domain entity ID this event relates to

Signature
domainId?: string;

id

Unique identifier for this event (auto-generated if not provided)

Signature
id?: string;

source

Source system or service that generated this event

Signature
source?: string;

stream

Event stream name (often matches aggregate type)

Signature
stream?: string;

type

Event type name (e.g., 'UserCreated', 'OrderShipped')

Signature
type: string;