extract projection snapshot logic
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
This commit is contained in:
13
src/main/kotlin/eventDemo/app/event/EventHandler.kt
Normal file
13
src/main/kotlin/eventDemo/app/event/EventHandler.kt
Normal file
@@ -0,0 +1,13 @@
|
||||
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
|
||||
}
|
||||
Reference in New Issue
Block a user