implement GameStateRepositoryTest
add lambda to the GameEventHandler.handle{} to set the version
add VersionBuilder
add version to the events
add creation date to the events
rename gameId to aggregateId
add EventHandler interface
14 lines
335 B
Kotlin
14 lines
335 B
Kotlin
package eventDemo.app.event
|
|
|
|
import eventDemo.libs.event.AggregateId
|
|
import eventDemo.libs.event.Event
|
|
|
|
/**
|
|
* A stream to publish and read the played card event.
|
|
*/
|
|
interface EventHandler<E : Event<ID>, ID : AggregateId> {
|
|
fun registerProjectionBuilder(builder: (E) -> Unit)
|
|
|
|
fun handle(buildEvent: (version: Int) -> E): E
|
|
}
|