Event class abstract

Base class for all events in the event sourcing system Events represent immutable facts that have occurred and are stored permanently

Implementers

Constructors

Event({String? eventId, DateTime? timestamp, int? version, Map<String, dynamic>? metadata})
Create an event with optional ID, timestamp, version, and metadata

Properties

correlationId → String
The correlation ID of the message.
no setter
eventId → String
Unique identifier for this event Used for deduplication and correlation
no setter
hashCode → int
The hash code for this object.
no setteroverride
metadata → Map<String, dynamic>
Additional metadata for the event Can include correlation IDs, causation IDs, user context, etc.
no setter
persistableMetadata → Map<String, dynamic>
metadata as it is persisted: transient ActorRef entries removed.
no setter
replyTo → ActorRef?
The actor to reply to, if a live ActorRef was placed in metadata['replyTo'].
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
timestamp → DateTime
Timestamp when the event occurred
no setter
typeName → String
Stable identity of this event type in storage.
no setter
version → int
Version/sequence number of this event within its aggregate Used for ordering and optimistic concurrency control
no setter

Methods

getValidationErrors() → List<String>
Get validation errors Override in subclasses to provide specific error messages
isValid() → bool
Validate the event Override in subclasses for custom validation
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toCbor() → List<int>
Serialize event to CBOR bytes
toMap() → Map<String, dynamic>
Convert event to a map for serialization.
toString() → String
A string representation of this object.
override

Operators

operator ==(Object other) → bool
The equality operator.
override

Static Methods

fromCbor(List<int> bytes) → Event
Create event from CBOR bytes Subclasses must implement their own fromCbor methods