feat: remove snapshot on ProjectionRepository
This commit is contained in:
+1
-6
@@ -1,12 +1,7 @@
|
||||
package eventDemo.business.event.projection
|
||||
|
||||
import eventDemo.business.entity.GameId
|
||||
import eventDemo.business.event.event.GameEvent
|
||||
|
||||
interface GameStateRepository {
|
||||
fun getLast(gameId: GameId): GameState
|
||||
|
||||
fun getUntil(event: GameEvent): GameState
|
||||
|
||||
fun count(gameId: GameId): Int
|
||||
fun get(gameId: GameId): GameState
|
||||
}
|
||||
|
||||
+2
-2
@@ -37,7 +37,7 @@ class ReactionListener(
|
||||
}
|
||||
}
|
||||
|
||||
private suspend fun sendStartGameEvent(state: GameState) {
|
||||
private fun sendStartGameEvent(state: GameState) {
|
||||
if (state.isReady && !state.isStarted) {
|
||||
val reactionEvent =
|
||||
eventHandler.handle(state.aggregateId) {
|
||||
@@ -54,7 +54,7 @@ class ReactionListener(
|
||||
}
|
||||
}
|
||||
|
||||
private suspend fun sendWinnerEvent(state: GameState) {
|
||||
private fun sendWinnerEvent(state: GameState) {
|
||||
val winner = state.playerHasNoCardLeft().firstOrNull()
|
||||
if (winner != null) {
|
||||
val reactionEvent =
|
||||
|
||||
Reference in New Issue
Block a user