The event you want to apply and add to the list of events that are not commited yet.
The event you want to apply to the current state. This function is used when you want to rehydrate your aggregate from your events store events.
Call this function clear the uncommmited events array after you saved them in your event store / repository.
The current commandId of your aggregate.
The current sequence of your aggregate.
All snapshots.
The list of events you added that need to be persisted in your event store. Call eventsCommited() when it's done to clear the array.
a snapshot (deep copy) of the current state.
Empty the snapshots array
The current state of you aggregate. Beware it's not a deep copy so if you mutate it. It will impact your aggregate state. It should never be used outside of you aggregate boundaries.
Generated using TypeDoc
This is the aggregate interface