EventAppendPreparer
class EventAppendPreparer<EVENT : Any, EVENT_PERSISTED : Any>(aggregateTypes: EventTypeNames.ForAggregate<EVENT>, codec: Codec<EVENT, EVENT_PERSISTED>, clock: Clock = Clock.System)(source)
Converts proposed domain events into immutable, persistence-ready appends with framework-owned stable event IDs. Normal users provide commands and receive committed events; this internal boundary creates the recovery unit needed only when persistence has an ambiguous outcome.
Constructors
Link copied to clipboard
constructor(aggregateTypes: EventTypeNames.ForAggregate<EVENT>, codec: Codec<EVENT, EVENT_PERSISTED>, clock: Clock = Clock.System)
Functions
Link copied to clipboard
fun prepare(aggregateId: String, expectedVersion: Long?, commandId: CommandId, correlationId: CorrelationId? = null, causedBy: EventReference? = null, occurredAt: Instant, events: List<ProposedEvent<EVENT>>, appendKey: AppendKey = AppendKey(Uuid.random().toString())): PreparedAppend<EVENT>
Prepares a non-empty atomic append. A null expectedVersion means the stream must not exist. The default framework-generated appendKey needs no caller input.