package aether import ( "time" ) // Event represents a domain event in the system type Event struct { ID string `json:"id"` EventType string `json:"eventType"` ActorID string `json:"actorId"` CommandID string `json:"commandId,omitempty"` // Correlation ID for command that triggered this event Version int64 `json:"version"` Data map[string]interface{} `json:"data"` Timestamp time.Time `json:"timestamp"` } // ActorSnapshot represents a point-in-time state snapshot type ActorSnapshot struct { ActorID string `json:"actorId"` Version int64 `json:"version"` State map[string]interface{} `json:"state"` Timestamp time.Time `json:"timestamp"` } // EventStore defines the interface for event persistence type EventStore interface { SaveEvent(event *Event) error GetEvents(actorID string, fromVersion int64) ([]*Event, error) GetLatestVersion(actorID string) (int64, error) } // SnapshotStore extends EventStore with snapshot capabilities type SnapshotStore interface { EventStore GetLatestSnapshot(actorID string) (*ActorSnapshot, error) SaveSnapshot(snapshot *ActorSnapshot) error }