Compare commits
1
Commits
v0.1
..
256524f63e
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
256524f63e
|
+3
-3
@@ -12,9 +12,9 @@ val kotest_version: String by project
|
|||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
application
|
application
|
||||||
kotlin("jvm") version "2.1.21"
|
kotlin("jvm") version "2.1.10"
|
||||||
id("io.ktor.plugin") version "3.5.1"
|
id("io.ktor.plugin") version "3.1.1"
|
||||||
id("org.jetbrains.kotlin.plugin.serialization") version "2.4.10"
|
id("org.jetbrains.kotlin.plugin.serialization") version "2.1.10"
|
||||||
id("org.jlleitschuh.gradle.ktlint") version "12.2.0"
|
id("org.jlleitschuh.gradle.ktlint") version "12.2.0"
|
||||||
id("com.avast.gradle.docker-compose") version "0.17.12"
|
id("com.avast.gradle.docker-compose") version "0.17.12"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
services:
|
services:
|
||||||
redis:
|
redis:
|
||||||
image: redis/redis-stack:7.4.0-v8
|
image: redis/redis-stack:7.4.0-v3
|
||||||
healthcheck:
|
healthcheck:
|
||||||
test: [ "CMD", "redis-cli", "--raw", "incr", "ping" ]
|
test: [ "CMD", "redis-cli", "--raw", "incr", "ping" ]
|
||||||
volumes:
|
volumes:
|
||||||
@@ -19,7 +19,7 @@ services:
|
|||||||
restart: no
|
restart: no
|
||||||
|
|
||||||
postgresql:
|
postgresql:
|
||||||
image: postgres:18.4
|
image: postgres:17.4
|
||||||
command: postgres -c 'max_connections=500'
|
command: postgres -c 'max_connections=500'
|
||||||
environment:
|
environment:
|
||||||
POSTGRES_PASSWORD_FILE: /run/secrets/postgresql_password
|
POSTGRES_PASSWORD_FILE: /run/secrets/postgresql_password
|
||||||
@@ -32,7 +32,7 @@ services:
|
|||||||
timeout: 5s
|
timeout: 5s
|
||||||
retries: 10
|
retries: 10
|
||||||
volumes:
|
volumes:
|
||||||
- postgresql_data:/var/lib/postgresql
|
- postgresql_data:/var/lib/postgresql/data
|
||||||
|
|
||||||
rabbitmq:
|
rabbitmq:
|
||||||
image: rabbitmq:4-management-alpine
|
image: rabbitmq:4-management-alpine
|
||||||
|
|||||||
+7
-7
@@ -1,9 +1,9 @@
|
|||||||
ktor_version=3.5.1
|
ktor_version=3.1.1
|
||||||
kotlin_version=2.1.21
|
kotlin_version=2.1.10
|
||||||
kotlin_serialization_version=1.11.0
|
kotlin_serialization_version=1.8.0
|
||||||
logback_version=1.5.38
|
logback_version=1.5.17
|
||||||
koin_version=4.2.1
|
koin_version=4.0.2
|
||||||
kotlin_logging_version=8.0.4
|
kotlin_logging_version=7.0.5
|
||||||
kotest_version=6.2.2
|
kotest_version=6.0.0.M2
|
||||||
|
|
||||||
kotlin.code.style=official
|
kotlin.code.style=official
|
||||||
|
|||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
distributionBase=GRADLE_USER_HOME
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-9.6.1-bin.zip
|
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
zipStorePath=wrapper/dists
|
zipStorePath=wrapper/dists
|
||||||
|
|||||||
+3
-3
@@ -1,7 +1,7 @@
|
|||||||
package eventDemo.adapter.infrastructure.event
|
package eventDemo.adapter.infrastructureLayer.event
|
||||||
|
|
||||||
import eventDemo.domain.event.GameEventBus
|
import eventDemo.business.event.GameEventBus
|
||||||
import eventDemo.domain.event.event.GameEvent
|
import eventDemo.business.event.event.GameEvent
|
||||||
import eventDemo.libs.bus.Bus
|
import eventDemo.libs.bus.Bus
|
||||||
import eventDemo.libs.bus.BusInMemory
|
import eventDemo.libs.bus.BusInMemory
|
||||||
import java.util.UUID
|
import java.util.UUID
|
||||||
+3
-3
@@ -1,8 +1,8 @@
|
|||||||
package eventDemo.adapter.infrastructure.event
|
package eventDemo.adapter.infrastructureLayer.event
|
||||||
|
|
||||||
import com.rabbitmq.client.ConnectionFactory
|
import com.rabbitmq.client.ConnectionFactory
|
||||||
import eventDemo.domain.event.GameEventBus
|
import eventDemo.business.event.GameEventBus
|
||||||
import eventDemo.domain.event.event.GameEvent
|
import eventDemo.business.event.event.GameEvent
|
||||||
import eventDemo.libs.bus.Bus
|
import eventDemo.libs.bus.Bus
|
||||||
import eventDemo.libs.bus.BusInRabbitMQ
|
import eventDemo.libs.bus.BusInRabbitMQ
|
||||||
import kotlinx.serialization.json.Json
|
import kotlinx.serialization.json.Json
|
||||||
+4
-4
@@ -1,8 +1,8 @@
|
|||||||
package eventDemo.adapter.infrastructure.event
|
package eventDemo.adapter.infrastructureLayer.event
|
||||||
|
|
||||||
import eventDemo.domain.entity.GameId
|
import eventDemo.business.entity.GameId
|
||||||
import eventDemo.domain.event.GameEventStore
|
import eventDemo.business.event.GameEventStore
|
||||||
import eventDemo.domain.event.event.GameEvent
|
import eventDemo.business.event.event.GameEvent
|
||||||
import eventDemo.libs.event.EventStore
|
import eventDemo.libs.event.EventStore
|
||||||
import eventDemo.libs.event.EventStoreInMemory
|
import eventDemo.libs.event.EventStoreInMemory
|
||||||
|
|
||||||
+4
-4
@@ -1,8 +1,8 @@
|
|||||||
package eventDemo.adapter.infrastructure.event
|
package eventDemo.adapter.infrastructureLayer.event
|
||||||
|
|
||||||
import eventDemo.domain.entity.GameId
|
import eventDemo.business.entity.GameId
|
||||||
import eventDemo.domain.event.GameEventStore
|
import eventDemo.business.event.GameEventStore
|
||||||
import eventDemo.domain.event.event.GameEvent
|
import eventDemo.business.event.event.GameEvent
|
||||||
import eventDemo.libs.event.EventStore
|
import eventDemo.libs.event.EventStore
|
||||||
import eventDemo.libs.event.EventStoreInPostgresql
|
import eventDemo.libs.event.EventStoreInPostgresql
|
||||||
import kotlinx.serialization.json.Json
|
import kotlinx.serialization.json.Json
|
||||||
+8
-8
@@ -1,12 +1,12 @@
|
|||||||
package eventDemo.adapter.infrastructure.event.projection
|
package eventDemo.adapter.infrastructureLayer.event.projection
|
||||||
|
|
||||||
import eventDemo.domain.entity.GameId
|
import eventDemo.business.entity.GameId
|
||||||
import eventDemo.domain.event.GameEventBus
|
import eventDemo.business.event.GameEventBus
|
||||||
import eventDemo.domain.event.projection.GameList
|
import eventDemo.business.event.projection.GameList
|
||||||
import eventDemo.domain.event.projection.GameListRepository
|
import eventDemo.business.event.projection.GameListRepository
|
||||||
import eventDemo.domain.event.projection.GameProjectionBus
|
import eventDemo.business.event.projection.GameProjectionBus
|
||||||
import eventDemo.domain.event.projection.GameState
|
import eventDemo.business.event.projection.GameState
|
||||||
import eventDemo.domain.event.projection.apply
|
import eventDemo.business.event.projection.apply
|
||||||
import eventDemo.libs.event.projection.ProjectionRepositoryInMemory
|
import eventDemo.libs.event.projection.ProjectionRepositoryInMemory
|
||||||
import io.github.oshai.kotlinlogging.withLoggingContext
|
import io.github.oshai.kotlinlogging.withLoggingContext
|
||||||
|
|
||||||
+8
-8
@@ -1,12 +1,12 @@
|
|||||||
package eventDemo.adapter.infrastructure.event.projection
|
package eventDemo.adapter.infrastructureLayer.event.projection
|
||||||
|
|
||||||
import eventDemo.domain.entity.GameId
|
import eventDemo.business.entity.GameId
|
||||||
import eventDemo.domain.event.GameEventBus
|
import eventDemo.business.event.GameEventBus
|
||||||
import eventDemo.domain.event.projection.GameList
|
import eventDemo.business.event.projection.GameList
|
||||||
import eventDemo.domain.event.projection.GameListRepository
|
import eventDemo.business.event.projection.GameListRepository
|
||||||
import eventDemo.domain.event.projection.GameProjectionBus
|
import eventDemo.business.event.projection.GameProjectionBus
|
||||||
import eventDemo.domain.event.projection.GameState
|
import eventDemo.business.event.projection.GameState
|
||||||
import eventDemo.domain.event.projection.apply
|
import eventDemo.business.event.projection.apply
|
||||||
import eventDemo.libs.event.projection.ProjectionRepositoryInRedis
|
import eventDemo.libs.event.projection.ProjectionRepositoryInRedis
|
||||||
import io.github.oshai.kotlinlogging.withLoggingContext
|
import io.github.oshai.kotlinlogging.withLoggingContext
|
||||||
import kotlinx.serialization.json.Json
|
import kotlinx.serialization.json.Json
|
||||||
+3
-3
@@ -1,7 +1,7 @@
|
|||||||
package eventDemo.adapter.infrastructure.event.projection
|
package eventDemo.adapter.infrastructureLayer.event.projection
|
||||||
|
|
||||||
import eventDemo.domain.event.projection.GameProjection
|
import eventDemo.business.event.projection.GameProjection
|
||||||
import eventDemo.domain.event.projection.GameProjectionBus
|
import eventDemo.business.event.projection.GameProjectionBus
|
||||||
import eventDemo.libs.bus.Bus
|
import eventDemo.libs.bus.Bus
|
||||||
import eventDemo.libs.bus.BusInMemory
|
import eventDemo.libs.bus.BusInMemory
|
||||||
import java.util.UUID
|
import java.util.UUID
|
||||||
+3
-3
@@ -1,8 +1,8 @@
|
|||||||
package eventDemo.adapter.infrastructure.event.projection
|
package eventDemo.adapter.infrastructureLayer.event.projection
|
||||||
|
|
||||||
import com.rabbitmq.client.ConnectionFactory
|
import com.rabbitmq.client.ConnectionFactory
|
||||||
import eventDemo.domain.event.projection.GameProjection
|
import eventDemo.business.event.projection.GameProjection
|
||||||
import eventDemo.domain.event.projection.GameProjectionBus
|
import eventDemo.business.event.projection.GameProjectionBus
|
||||||
import eventDemo.libs.bus.Bus
|
import eventDemo.libs.bus.Bus
|
||||||
import eventDemo.libs.bus.BusInRabbitMQ
|
import eventDemo.libs.bus.BusInRabbitMQ
|
||||||
import kotlinx.serialization.json.Json
|
import kotlinx.serialization.json.Json
|
||||||
+7
-7
@@ -1,11 +1,11 @@
|
|||||||
package eventDemo.adapter.infrastructure.event.projection
|
package eventDemo.adapter.infrastructureLayer.event.projection
|
||||||
|
|
||||||
import eventDemo.domain.entity.GameId
|
import eventDemo.business.entity.GameId
|
||||||
import eventDemo.domain.event.GameEventBus
|
import eventDemo.business.event.GameEventBus
|
||||||
import eventDemo.domain.event.projection.GameProjectionBus
|
import eventDemo.business.event.projection.GameProjectionBus
|
||||||
import eventDemo.domain.event.projection.GameState
|
import eventDemo.business.event.projection.GameState
|
||||||
import eventDemo.domain.event.projection.GameStateRepository
|
import eventDemo.business.event.projection.GameStateRepository
|
||||||
import eventDemo.domain.event.projection.apply
|
import eventDemo.business.event.projection.apply
|
||||||
import eventDemo.libs.event.projection.ProjectionRepositoryInMemory
|
import eventDemo.libs.event.projection.ProjectionRepositoryInMemory
|
||||||
import io.github.oshai.kotlinlogging.withLoggingContext
|
import io.github.oshai.kotlinlogging.withLoggingContext
|
||||||
|
|
||||||
+7
-7
@@ -1,11 +1,11 @@
|
|||||||
package eventDemo.adapter.infrastructure.event.projection
|
package eventDemo.adapter.infrastructureLayer.event.projection
|
||||||
|
|
||||||
import eventDemo.domain.entity.GameId
|
import eventDemo.business.entity.GameId
|
||||||
import eventDemo.domain.event.GameEventBus
|
import eventDemo.business.event.GameEventBus
|
||||||
import eventDemo.domain.event.projection.GameProjectionBus
|
import eventDemo.business.event.projection.GameProjectionBus
|
||||||
import eventDemo.domain.event.projection.GameState
|
import eventDemo.business.event.projection.GameState
|
||||||
import eventDemo.domain.event.projection.GameStateRepository
|
import eventDemo.business.event.projection.GameStateRepository
|
||||||
import eventDemo.domain.event.projection.apply
|
import eventDemo.business.event.projection.apply
|
||||||
import eventDemo.libs.event.projection.ProjectionRepositoryInRedis
|
import eventDemo.libs.event.projection.ProjectionRepositoryInRedis
|
||||||
import io.github.oshai.kotlinlogging.withLoggingContext
|
import io.github.oshai.kotlinlogging.withLoggingContext
|
||||||
import kotlinx.serialization.json.Json
|
import kotlinx.serialization.json.Json
|
||||||
+6
-6
@@ -1,10 +1,10 @@
|
|||||||
package eventDemo.adapter.presenter.query
|
package eventDemo.adapter.interfaceLayer.query
|
||||||
|
|
||||||
import eventDemo.domain.command.GameCommandHandler
|
import eventDemo.business.command.GameCommandHandler
|
||||||
import eventDemo.domain.command.command.GameCommand
|
import eventDemo.business.command.command.GameCommand
|
||||||
import eventDemo.domain.entity.GameId
|
import eventDemo.business.entity.GameId
|
||||||
import eventDemo.domain.event.projection.projectionListener.PlayerNotificationListener
|
import eventDemo.business.event.projection.projectionListener.PlayerNotificationListener
|
||||||
import eventDemo.domain.notification.Notification
|
import eventDemo.business.notification.Notification
|
||||||
import eventDemo.libs.fromFrameChannel
|
import eventDemo.libs.fromFrameChannel
|
||||||
import eventDemo.libs.toObjectChannel
|
import eventDemo.libs.toObjectChannel
|
||||||
import io.github.oshai.kotlinlogging.withLoggingContext
|
import io.github.oshai.kotlinlogging.withLoggingContext
|
||||||
+2
-2
@@ -1,6 +1,6 @@
|
|||||||
package eventDemo.adapter.presenter.query
|
package eventDemo.adapter.interfaceLayer.query
|
||||||
|
|
||||||
import eventDemo.domain.event.projection.GameListRepository
|
import eventDemo.business.event.projection.GameListRepository
|
||||||
import io.ktor.resources.Resource
|
import io.ktor.resources.Resource
|
||||||
import io.ktor.server.auth.authenticate
|
import io.ktor.server.auth.authenticate
|
||||||
import io.ktor.server.resources.get
|
import io.ktor.server.resources.get
|
||||||
+2
-2
@@ -1,6 +1,6 @@
|
|||||||
package eventDemo.adapter.presenter.query
|
package eventDemo.adapter.interfaceLayer.query
|
||||||
|
|
||||||
import eventDemo.domain.entity.Player
|
import eventDemo.business.entity.Player
|
||||||
import io.ktor.server.application.ApplicationCall
|
import io.ktor.server.application.ApplicationCall
|
||||||
import io.ktor.server.auth.jwt.JWTPrincipal
|
import io.ktor.server.auth.jwt.JWTPrincipal
|
||||||
import io.ktor.server.auth.principal
|
import io.ktor.server.auth.principal
|
||||||
+3
-3
@@ -1,7 +1,7 @@
|
|||||||
package eventDemo.adapter.presenter.query
|
package eventDemo.adapter.interfaceLayer.query
|
||||||
|
|
||||||
import eventDemo.domain.entity.GameId
|
import eventDemo.business.entity.GameId
|
||||||
import eventDemo.domain.event.projection.GameStateRepository
|
import eventDemo.business.event.projection.GameStateRepository
|
||||||
import eventDemo.configuration.serializer.GameIdSerializer
|
import eventDemo.configuration.serializer.GameIdSerializer
|
||||||
import io.ktor.http.HttpStatusCode
|
import io.ktor.http.HttpStatusCode
|
||||||
import io.ktor.resources.Resource
|
import io.ktor.resources.Resource
|
||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
package eventDemo.domain.command
|
package eventDemo.business.command
|
||||||
|
|
||||||
class CommandException(
|
class CommandException(
|
||||||
override val message: String,
|
override val message: String,
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
package eventDemo.business.command
|
||||||
|
|
||||||
|
import eventDemo.business.command.action.ICantPlay
|
||||||
|
import eventDemo.business.command.action.IWantToJoinTheGame
|
||||||
|
import eventDemo.business.command.action.IWantToPlayCard
|
||||||
|
import eventDemo.business.command.action.IamReadyToPlay
|
||||||
|
import eventDemo.business.command.command.GameCommand
|
||||||
|
import eventDemo.business.command.command.ICantPlayCommand
|
||||||
|
import eventDemo.business.command.command.IWantToJoinTheGameCommand
|
||||||
|
import eventDemo.business.command.command.IWantToPlayCardCommand
|
||||||
|
import eventDemo.business.command.command.IamReadyToPlayCommand
|
||||||
|
import eventDemo.business.event.event.GameEvent
|
||||||
|
|
||||||
|
class GameCommandActionRunner(
|
||||||
|
private val iWantToPlayCard: IWantToPlayCard,
|
||||||
|
private val iamReadyToPlay: IamReadyToPlay,
|
||||||
|
private val iWantToJoinTheGame: IWantToJoinTheGame,
|
||||||
|
private val iCantPlay: ICantPlay,
|
||||||
|
) {
|
||||||
|
fun run(command: GameCommand): (version: Int) -> GameEvent =
|
||||||
|
when (command) {
|
||||||
|
is IWantToPlayCardCommand -> iWantToPlayCard.run(command)
|
||||||
|
is IamReadyToPlayCommand -> iamReadyToPlay.run(command)
|
||||||
|
is IWantToJoinTheGameCommand -> iWantToJoinTheGame.run(command)
|
||||||
|
is ICantPlayCommand -> iCantPlay.run(command)
|
||||||
|
}
|
||||||
|
}
|
||||||
+10
-10
@@ -1,14 +1,14 @@
|
|||||||
package eventDemo.domain.command
|
package eventDemo.business.command
|
||||||
|
|
||||||
import eventDemo.domain.command.command.GameCommand
|
import eventDemo.business.command.command.GameCommand
|
||||||
import eventDemo.domain.entity.GameId
|
import eventDemo.business.entity.GameId
|
||||||
import eventDemo.domain.entity.Player
|
import eventDemo.business.entity.Player
|
||||||
import eventDemo.domain.event.GameEventBus
|
import eventDemo.business.event.GameEventBus
|
||||||
import eventDemo.domain.event.GameEventStore
|
import eventDemo.business.event.GameEventStore
|
||||||
import eventDemo.domain.event.event.GameEvent
|
import eventDemo.business.event.event.GameEvent
|
||||||
import eventDemo.domain.notification.CommandErrorNotification
|
import eventDemo.business.notification.CommandErrorNotification
|
||||||
import eventDemo.domain.notification.CommandSuccessNotification
|
import eventDemo.business.notification.CommandSuccessNotification
|
||||||
import eventDemo.domain.notification.Notification
|
import eventDemo.business.notification.Notification
|
||||||
import eventDemo.libs.command.CommandHandler
|
import eventDemo.libs.command.CommandHandler
|
||||||
import eventDemo.libs.command.CommandRunnerController
|
import eventDemo.libs.command.CommandRunnerController
|
||||||
import eventDemo.libs.event.EventHandlerImpl
|
import eventDemo.libs.event.EventHandlerImpl
|
||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
package eventDemo.domain.command.action
|
package eventDemo.business.command.action
|
||||||
|
|
||||||
import eventDemo.libs.command.Command
|
import eventDemo.libs.command.Command
|
||||||
import eventDemo.libs.event.Event
|
import eventDemo.libs.event.Event
|
||||||
+5
-5
@@ -1,9 +1,9 @@
|
|||||||
package eventDemo.domain.command.action
|
package eventDemo.business.command.action
|
||||||
|
|
||||||
import eventDemo.domain.command.CommandException
|
import eventDemo.business.command.CommandException
|
||||||
import eventDemo.domain.command.command.ICantPlayCommand
|
import eventDemo.business.command.command.ICantPlayCommand
|
||||||
import eventDemo.domain.event.event.PlayerHavePassEvent
|
import eventDemo.business.event.event.PlayerHavePassEvent
|
||||||
import eventDemo.domain.event.projection.GameStateRepository
|
import eventDemo.business.event.projection.GameStateRepository
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A command to perform an action to play a new card
|
* A command to perform an action to play a new card
|
||||||
+5
-5
@@ -1,9 +1,9 @@
|
|||||||
package eventDemo.domain.command.action
|
package eventDemo.business.command.action
|
||||||
|
|
||||||
import eventDemo.domain.command.CommandException
|
import eventDemo.business.command.CommandException
|
||||||
import eventDemo.domain.command.command.IWantToJoinTheGameCommand
|
import eventDemo.business.command.command.IWantToJoinTheGameCommand
|
||||||
import eventDemo.domain.event.event.NewPlayerEvent
|
import eventDemo.business.event.event.NewPlayerEvent
|
||||||
import eventDemo.domain.event.projection.GameStateRepository
|
import eventDemo.business.event.projection.GameStateRepository
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A command to perform an action to play a new card
|
* A command to perform an action to play a new card
|
||||||
+5
-5
@@ -1,9 +1,9 @@
|
|||||||
package eventDemo.domain.command.action
|
package eventDemo.business.command.action
|
||||||
|
|
||||||
import eventDemo.domain.command.CommandException
|
import eventDemo.business.command.CommandException
|
||||||
import eventDemo.domain.command.command.IWantToPlayCardCommand
|
import eventDemo.business.command.command.IWantToPlayCardCommand
|
||||||
import eventDemo.domain.event.event.CardIsPlayedEvent
|
import eventDemo.business.event.event.CardIsPlayedEvent
|
||||||
import eventDemo.domain.event.projection.GameStateRepository
|
import eventDemo.business.event.projection.GameStateRepository
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A command to perform an action to play a new card
|
* A command to perform an action to play a new card
|
||||||
+5
-5
@@ -1,9 +1,9 @@
|
|||||||
package eventDemo.domain.command.action
|
package eventDemo.business.command.action
|
||||||
|
|
||||||
import eventDemo.domain.command.CommandException
|
import eventDemo.business.command.CommandException
|
||||||
import eventDemo.domain.command.command.IamReadyToPlayCommand
|
import eventDemo.business.command.command.IamReadyToPlayCommand
|
||||||
import eventDemo.domain.event.event.PlayerReadyEvent
|
import eventDemo.business.event.event.PlayerReadyEvent
|
||||||
import eventDemo.domain.event.projection.GameStateRepository
|
import eventDemo.business.event.projection.GameStateRepository
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A command to set as ready to play
|
* A command to set as ready to play
|
||||||
+3
-3
@@ -1,7 +1,7 @@
|
|||||||
package eventDemo.domain.command.command
|
package eventDemo.business.command.command
|
||||||
|
|
||||||
import eventDemo.domain.entity.GameId
|
import eventDemo.business.entity.GameId
|
||||||
import eventDemo.domain.entity.Player
|
import eventDemo.business.entity.Player
|
||||||
import eventDemo.libs.command.Command
|
import eventDemo.libs.command.Command
|
||||||
import kotlinx.serialization.Serializable
|
import kotlinx.serialization.Serializable
|
||||||
|
|
||||||
+3
-3
@@ -1,7 +1,7 @@
|
|||||||
package eventDemo.domain.command.command
|
package eventDemo.business.command.command
|
||||||
|
|
||||||
import eventDemo.domain.entity.GameId
|
import eventDemo.business.entity.GameId
|
||||||
import eventDemo.domain.entity.Player
|
import eventDemo.business.entity.Player
|
||||||
import eventDemo.libs.command.CommandId
|
import eventDemo.libs.command.CommandId
|
||||||
import kotlinx.serialization.Serializable
|
import kotlinx.serialization.Serializable
|
||||||
|
|
||||||
+3
-3
@@ -1,7 +1,7 @@
|
|||||||
package eventDemo.domain.command.command
|
package eventDemo.business.command.command
|
||||||
|
|
||||||
import eventDemo.domain.entity.GameId
|
import eventDemo.business.entity.GameId
|
||||||
import eventDemo.domain.entity.Player
|
import eventDemo.business.entity.Player
|
||||||
import eventDemo.libs.command.CommandId
|
import eventDemo.libs.command.CommandId
|
||||||
import kotlinx.serialization.Serializable
|
import kotlinx.serialization.Serializable
|
||||||
|
|
||||||
+4
-4
@@ -1,8 +1,8 @@
|
|||||||
package eventDemo.domain.command.command
|
package eventDemo.business.command.command
|
||||||
|
|
||||||
import eventDemo.domain.entity.Card
|
import eventDemo.business.entity.Card
|
||||||
import eventDemo.domain.entity.GameId
|
import eventDemo.business.entity.GameId
|
||||||
import eventDemo.domain.entity.Player
|
import eventDemo.business.entity.Player
|
||||||
import eventDemo.libs.command.CommandId
|
import eventDemo.libs.command.CommandId
|
||||||
import kotlinx.serialization.Serializable
|
import kotlinx.serialization.Serializable
|
||||||
|
|
||||||
+3
-3
@@ -1,7 +1,7 @@
|
|||||||
package eventDemo.domain.command.command
|
package eventDemo.business.command.command
|
||||||
|
|
||||||
import eventDemo.domain.entity.GameId
|
import eventDemo.business.entity.GameId
|
||||||
import eventDemo.domain.entity.Player
|
import eventDemo.business.entity.Player
|
||||||
import eventDemo.libs.command.CommandId
|
import eventDemo.libs.command.CommandId
|
||||||
import kotlinx.serialization.Serializable
|
import kotlinx.serialization.Serializable
|
||||||
|
|
||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
package eventDemo.domain.entity
|
package eventDemo.business.entity
|
||||||
|
|
||||||
import eventDemo.configuration.serializer.UUIDSerializer
|
import eventDemo.configuration.serializer.UUIDSerializer
|
||||||
import kotlinx.serialization.SerialName
|
import kotlinx.serialization.SerialName
|
||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
package eventDemo.domain.entity
|
package eventDemo.business.entity
|
||||||
|
|
||||||
import kotlinx.serialization.Serializable
|
import kotlinx.serialization.Serializable
|
||||||
|
|
||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
package eventDemo.domain.entity
|
package eventDemo.business.entity
|
||||||
|
|
||||||
import eventDemo.configuration.serializer.GameIdSerializer
|
import eventDemo.configuration.serializer.GameIdSerializer
|
||||||
import eventDemo.libs.event.AggregateId
|
import eventDemo.libs.event.AggregateId
|
||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
package eventDemo.domain.entity
|
package eventDemo.business.entity
|
||||||
|
|
||||||
import eventDemo.configuration.serializer.PlayerIdSerializer
|
import eventDemo.configuration.serializer.PlayerIdSerializer
|
||||||
import eventDemo.configuration.serializer.UUIDSerializer
|
import eventDemo.configuration.serializer.UUIDSerializer
|
||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
package eventDemo.domain.entity
|
package eventDemo.business.entity
|
||||||
|
|
||||||
import kotlinx.serialization.Serializable
|
import kotlinx.serialization.Serializable
|
||||||
|
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
package eventDemo.business.event
|
||||||
|
|
||||||
|
import eventDemo.business.event.event.GameEvent
|
||||||
|
import eventDemo.libs.bus.Bus
|
||||||
|
|
||||||
|
interface GameEventBus : Bus<GameEvent>
|
||||||
+3
-3
@@ -1,7 +1,7 @@
|
|||||||
package eventDemo.domain.event
|
package eventDemo.business.event
|
||||||
|
|
||||||
import eventDemo.domain.entity.GameId
|
import eventDemo.business.entity.GameId
|
||||||
import eventDemo.domain.event.event.GameEvent
|
import eventDemo.business.event.event.GameEvent
|
||||||
import eventDemo.libs.event.EventHandler
|
import eventDemo.libs.event.EventHandler
|
||||||
import eventDemo.libs.event.EventHandlerImpl
|
import eventDemo.libs.event.EventHandlerImpl
|
||||||
import eventDemo.libs.event.VersionBuilder
|
import eventDemo.libs.event.VersionBuilder
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
package eventDemo.business.event
|
||||||
|
|
||||||
|
import eventDemo.business.entity.GameId
|
||||||
|
import eventDemo.business.event.event.GameEvent
|
||||||
|
import eventDemo.libs.event.EventStore
|
||||||
|
|
||||||
|
interface GameEventStore : EventStore<GameEvent, GameId>
|
||||||
+4
-4
@@ -1,8 +1,8 @@
|
|||||||
package eventDemo.domain.event.event
|
package eventDemo.business.event.event
|
||||||
|
|
||||||
import eventDemo.domain.entity.Card
|
import eventDemo.business.entity.Card
|
||||||
import eventDemo.domain.entity.GameId
|
import eventDemo.business.entity.GameId
|
||||||
import eventDemo.domain.entity.Player
|
import eventDemo.business.entity.Player
|
||||||
import eventDemo.configuration.serializer.UUIDSerializer
|
import eventDemo.configuration.serializer.UUIDSerializer
|
||||||
import kotlinx.datetime.Clock
|
import kotlinx.datetime.Clock
|
||||||
import kotlinx.datetime.Instant
|
import kotlinx.datetime.Instant
|
||||||
+2
-2
@@ -1,6 +1,6 @@
|
|||||||
package eventDemo.domain.event.event
|
package eventDemo.business.event.event
|
||||||
|
|
||||||
import eventDemo.domain.entity.GameId
|
import eventDemo.business.entity.GameId
|
||||||
import eventDemo.libs.event.Event
|
import eventDemo.libs.event.Event
|
||||||
import kotlinx.serialization.Serializable
|
import kotlinx.serialization.Serializable
|
||||||
import java.util.UUID
|
import java.util.UUID
|
||||||
+5
-5
@@ -1,9 +1,9 @@
|
|||||||
package eventDemo.domain.event.event
|
package eventDemo.business.event.event
|
||||||
|
|
||||||
import eventDemo.domain.entity.Deck
|
import eventDemo.business.entity.Deck
|
||||||
import eventDemo.domain.entity.GameId
|
import eventDemo.business.entity.GameId
|
||||||
import eventDemo.domain.entity.Player
|
import eventDemo.business.entity.Player
|
||||||
import eventDemo.domain.entity.initHands
|
import eventDemo.business.entity.initHands
|
||||||
import eventDemo.configuration.serializer.UUIDSerializer
|
import eventDemo.configuration.serializer.UUIDSerializer
|
||||||
import kotlinx.datetime.Clock
|
import kotlinx.datetime.Clock
|
||||||
import kotlinx.datetime.Instant
|
import kotlinx.datetime.Instant
|
||||||
+3
-3
@@ -1,7 +1,7 @@
|
|||||||
package eventDemo.domain.event.event
|
package eventDemo.business.event.event
|
||||||
|
|
||||||
import eventDemo.domain.entity.GameId
|
import eventDemo.business.entity.GameId
|
||||||
import eventDemo.domain.entity.Player
|
import eventDemo.business.entity.Player
|
||||||
import eventDemo.configuration.serializer.UUIDSerializer
|
import eventDemo.configuration.serializer.UUIDSerializer
|
||||||
import kotlinx.datetime.Clock
|
import kotlinx.datetime.Clock
|
||||||
import kotlinx.datetime.Instant
|
import kotlinx.datetime.Instant
|
||||||
+2
-2
@@ -1,6 +1,6 @@
|
|||||||
package eventDemo.domain.event.event
|
package eventDemo.business.event.event
|
||||||
|
|
||||||
import eventDemo.domain.entity.Player
|
import eventDemo.business.entity.Player
|
||||||
import kotlinx.serialization.Serializable
|
import kotlinx.serialization.Serializable
|
||||||
|
|
||||||
@Serializable
|
@Serializable
|
||||||
+4
-4
@@ -1,8 +1,8 @@
|
|||||||
package eventDemo.domain.event.event
|
package eventDemo.business.event.event
|
||||||
|
|
||||||
import eventDemo.domain.entity.Card
|
import eventDemo.business.entity.Card
|
||||||
import eventDemo.domain.entity.GameId
|
import eventDemo.business.entity.GameId
|
||||||
import eventDemo.domain.entity.Player
|
import eventDemo.business.entity.Player
|
||||||
import eventDemo.configuration.serializer.UUIDSerializer
|
import eventDemo.configuration.serializer.UUIDSerializer
|
||||||
import kotlinx.datetime.Clock
|
import kotlinx.datetime.Clock
|
||||||
import kotlinx.datetime.Instant
|
import kotlinx.datetime.Instant
|
||||||
+4
-4
@@ -1,8 +1,8 @@
|
|||||||
package eventDemo.domain.event.event
|
package eventDemo.business.event.event
|
||||||
|
|
||||||
import eventDemo.domain.entity.Card
|
import eventDemo.business.entity.Card
|
||||||
import eventDemo.domain.entity.GameId
|
import eventDemo.business.entity.GameId
|
||||||
import eventDemo.domain.entity.Player
|
import eventDemo.business.entity.Player
|
||||||
import eventDemo.configuration.serializer.UUIDSerializer
|
import eventDemo.configuration.serializer.UUIDSerializer
|
||||||
import kotlinx.datetime.Clock
|
import kotlinx.datetime.Clock
|
||||||
import kotlinx.datetime.Instant
|
import kotlinx.datetime.Instant
|
||||||
+3
-3
@@ -1,7 +1,7 @@
|
|||||||
package eventDemo.domain.event.event
|
package eventDemo.business.event.event
|
||||||
|
|
||||||
import eventDemo.domain.entity.GameId
|
import eventDemo.business.entity.GameId
|
||||||
import eventDemo.domain.entity.Player
|
import eventDemo.business.entity.Player
|
||||||
import eventDemo.configuration.serializer.UUIDSerializer
|
import eventDemo.configuration.serializer.UUIDSerializer
|
||||||
import kotlinx.datetime.Clock
|
import kotlinx.datetime.Clock
|
||||||
import kotlinx.datetime.Instant
|
import kotlinx.datetime.Instant
|
||||||
+3
-3
@@ -1,7 +1,7 @@
|
|||||||
package eventDemo.domain.event.event
|
package eventDemo.business.event.event
|
||||||
|
|
||||||
import eventDemo.domain.entity.GameId
|
import eventDemo.business.entity.GameId
|
||||||
import eventDemo.domain.entity.Player
|
import eventDemo.business.entity.Player
|
||||||
import eventDemo.configuration.serializer.UUIDSerializer
|
import eventDemo.configuration.serializer.UUIDSerializer
|
||||||
import kotlinx.datetime.Clock
|
import kotlinx.datetime.Clock
|
||||||
import kotlinx.datetime.Instant
|
import kotlinx.datetime.Instant
|
||||||
+2
-2
@@ -1,6 +1,6 @@
|
|||||||
package eventDemo.domain.event.projection
|
package eventDemo.business.event.projection
|
||||||
|
|
||||||
import eventDemo.domain.entity.GameId
|
import eventDemo.business.entity.GameId
|
||||||
import eventDemo.libs.event.projection.Projection
|
import eventDemo.libs.event.projection.Projection
|
||||||
import kotlinx.serialization.Serializable
|
import kotlinx.serialization.Serializable
|
||||||
|
|
||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
package eventDemo.domain.event.projection
|
package eventDemo.business.event.projection
|
||||||
|
|
||||||
import eventDemo.libs.bus.Bus
|
import eventDemo.libs.bus.Bus
|
||||||
|
|
||||||
+3
-3
@@ -1,7 +1,7 @@
|
|||||||
package eventDemo.domain.event.projection
|
package eventDemo.business.event.projection
|
||||||
|
|
||||||
import eventDemo.domain.entity.GameId
|
import eventDemo.business.entity.GameId
|
||||||
import eventDemo.domain.entity.Player
|
import eventDemo.business.entity.Player
|
||||||
import eventDemo.libs.event.projection.Projection
|
import eventDemo.libs.event.projection.Projection
|
||||||
import kotlinx.serialization.Serializable
|
import kotlinx.serialization.Serializable
|
||||||
|
|
||||||
+9
-9
@@ -1,13 +1,13 @@
|
|||||||
package eventDemo.domain.event.projection
|
package eventDemo.business.event.projection
|
||||||
|
|
||||||
import eventDemo.domain.event.event.CardIsPlayedEvent
|
import eventDemo.business.event.event.CardIsPlayedEvent
|
||||||
import eventDemo.domain.event.event.GameEvent
|
import eventDemo.business.event.event.GameEvent
|
||||||
import eventDemo.domain.event.event.GameStartedEvent
|
import eventDemo.business.event.event.GameStartedEvent
|
||||||
import eventDemo.domain.event.event.NewPlayerEvent
|
import eventDemo.business.event.event.NewPlayerEvent
|
||||||
import eventDemo.domain.event.event.PlayerChoseColorEvent
|
import eventDemo.business.event.event.PlayerChoseColorEvent
|
||||||
import eventDemo.domain.event.event.PlayerHavePassEvent
|
import eventDemo.business.event.event.PlayerHavePassEvent
|
||||||
import eventDemo.domain.event.event.PlayerReadyEvent
|
import eventDemo.business.event.event.PlayerReadyEvent
|
||||||
import eventDemo.domain.event.event.PlayerWinEvent
|
import eventDemo.business.event.event.PlayerWinEvent
|
||||||
|
|
||||||
fun GameList.apply(event: GameEvent): GameList =
|
fun GameList.apply(event: GameEvent): GameList =
|
||||||
when (event) {
|
when (event) {
|
||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
package eventDemo.domain.event.projection
|
package eventDemo.business.event.projection
|
||||||
|
|
||||||
interface GameListRepository {
|
interface GameListRepository {
|
||||||
fun getList(): List<GameList>
|
fun getList(): List<GameList>
|
||||||
+6
-6
@@ -1,10 +1,10 @@
|
|||||||
package eventDemo.domain.event.projection
|
package eventDemo.business.event.projection
|
||||||
|
|
||||||
import eventDemo.domain.entity.Card
|
import eventDemo.business.entity.Card
|
||||||
import eventDemo.domain.entity.Deck
|
import eventDemo.business.entity.Deck
|
||||||
import eventDemo.domain.entity.GameId
|
import eventDemo.business.entity.GameId
|
||||||
import eventDemo.domain.entity.Player
|
import eventDemo.business.entity.Player
|
||||||
import eventDemo.domain.event.event.GameEvent
|
import eventDemo.business.event.event.GameEvent
|
||||||
import eventDemo.libs.event.projection.Projection
|
import eventDemo.libs.event.projection.Projection
|
||||||
import kotlinx.serialization.Serializable
|
import kotlinx.serialization.Serializable
|
||||||
|
|
||||||
+11
-11
@@ -1,15 +1,15 @@
|
|||||||
package eventDemo.domain.event.projection
|
package eventDemo.business.event.projection
|
||||||
|
|
||||||
import eventDemo.domain.entity.Card
|
import eventDemo.business.entity.Card
|
||||||
import eventDemo.domain.event.event.CardIsPlayedEvent
|
import eventDemo.business.event.event.CardIsPlayedEvent
|
||||||
import eventDemo.domain.event.event.GameEvent
|
import eventDemo.business.event.event.GameEvent
|
||||||
import eventDemo.domain.event.event.GameStartedEvent
|
import eventDemo.business.event.event.GameStartedEvent
|
||||||
import eventDemo.domain.event.event.NewPlayerEvent
|
import eventDemo.business.event.event.NewPlayerEvent
|
||||||
import eventDemo.domain.event.event.PlayerActionEvent
|
import eventDemo.business.event.event.PlayerActionEvent
|
||||||
import eventDemo.domain.event.event.PlayerChoseColorEvent
|
import eventDemo.business.event.event.PlayerChoseColorEvent
|
||||||
import eventDemo.domain.event.event.PlayerHavePassEvent
|
import eventDemo.business.event.event.PlayerHavePassEvent
|
||||||
import eventDemo.domain.event.event.PlayerReadyEvent
|
import eventDemo.business.event.event.PlayerReadyEvent
|
||||||
import eventDemo.domain.event.event.PlayerWinEvent
|
import eventDemo.business.event.event.PlayerWinEvent
|
||||||
import io.github.oshai.kotlinlogging.KotlinLogging
|
import io.github.oshai.kotlinlogging.KotlinLogging
|
||||||
|
|
||||||
fun GameState.apply(event: GameEvent): GameState =
|
fun GameState.apply(event: GameEvent): GameState =
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
package eventDemo.business.event.projection
|
||||||
|
|
||||||
|
import eventDemo.business.entity.GameId
|
||||||
|
|
||||||
|
interface GameStateRepository {
|
||||||
|
fun get(gameId: GameId): GameState
|
||||||
|
}
|
||||||
+24
-24
@@ -1,28 +1,28 @@
|
|||||||
package eventDemo.domain.event.projection.projectionListener
|
package eventDemo.business.event.projection.projectionListener
|
||||||
|
|
||||||
import eventDemo.domain.entity.Card
|
import eventDemo.business.entity.Card
|
||||||
import eventDemo.domain.entity.GameId
|
import eventDemo.business.entity.GameId
|
||||||
import eventDemo.domain.entity.Player
|
import eventDemo.business.entity.Player
|
||||||
import eventDemo.domain.event.event.CardIsPlayedEvent
|
import eventDemo.business.event.event.CardIsPlayedEvent
|
||||||
import eventDemo.domain.event.event.GameStartedEvent
|
import eventDemo.business.event.event.GameStartedEvent
|
||||||
import eventDemo.domain.event.event.NewPlayerEvent
|
import eventDemo.business.event.event.NewPlayerEvent
|
||||||
import eventDemo.domain.event.event.PlayerChoseColorEvent
|
import eventDemo.business.event.event.PlayerChoseColorEvent
|
||||||
import eventDemo.domain.event.event.PlayerHavePassEvent
|
import eventDemo.business.event.event.PlayerHavePassEvent
|
||||||
import eventDemo.domain.event.event.PlayerReadyEvent
|
import eventDemo.business.event.event.PlayerReadyEvent
|
||||||
import eventDemo.domain.event.event.PlayerWinEvent
|
import eventDemo.business.event.event.PlayerWinEvent
|
||||||
import eventDemo.domain.event.projection.GameProjectionBus
|
import eventDemo.business.event.projection.GameProjectionBus
|
||||||
import eventDemo.domain.event.projection.GameState
|
import eventDemo.business.event.projection.GameState
|
||||||
import eventDemo.domain.notification.ItsTheTurnOfNotification
|
import eventDemo.business.notification.ItsTheTurnOfNotification
|
||||||
import eventDemo.domain.notification.Notification
|
import eventDemo.business.notification.Notification
|
||||||
import eventDemo.domain.notification.PlayerAsJoinTheGameNotification
|
import eventDemo.business.notification.PlayerAsJoinTheGameNotification
|
||||||
import eventDemo.domain.notification.PlayerAsPlayACardNotification
|
import eventDemo.business.notification.PlayerAsPlayACardNotification
|
||||||
import eventDemo.domain.notification.PlayerHavePassNotification
|
import eventDemo.business.notification.PlayerHavePassNotification
|
||||||
import eventDemo.domain.notification.PlayerWasChoseTheCardColorNotification
|
import eventDemo.business.notification.PlayerWasChoseTheCardColorNotification
|
||||||
import eventDemo.domain.notification.PlayerWasReadyNotification
|
import eventDemo.business.notification.PlayerWasReadyNotification
|
||||||
import eventDemo.domain.notification.PlayerWinNotification
|
import eventDemo.business.notification.PlayerWinNotification
|
||||||
import eventDemo.domain.notification.TheGameWasStartedNotification
|
import eventDemo.business.notification.TheGameWasStartedNotification
|
||||||
import eventDemo.domain.notification.WelcomeToTheGameNotification
|
import eventDemo.business.notification.WelcomeToTheGameNotification
|
||||||
import eventDemo.domain.notification.YourNewCardNotification
|
import eventDemo.business.notification.YourNewCardNotification
|
||||||
import io.github.oshai.kotlinlogging.KotlinLogging
|
import io.github.oshai.kotlinlogging.KotlinLogging
|
||||||
import io.github.oshai.kotlinlogging.withLoggingContext
|
import io.github.oshai.kotlinlogging.withLoggingContext
|
||||||
|
|
||||||
+7
-7
@@ -1,11 +1,11 @@
|
|||||||
package eventDemo.domain.event.projection.projectionListener
|
package eventDemo.business.event.projection.projectionListener
|
||||||
|
|
||||||
import eventDemo.domain.entity.GameId
|
import eventDemo.business.entity.GameId
|
||||||
import eventDemo.domain.event.GameEventHandler
|
import eventDemo.business.event.GameEventHandler
|
||||||
import eventDemo.domain.event.event.GameStartedEvent
|
import eventDemo.business.event.event.GameStartedEvent
|
||||||
import eventDemo.domain.event.event.PlayerWinEvent
|
import eventDemo.business.event.event.PlayerWinEvent
|
||||||
import eventDemo.domain.event.projection.GameProjectionBus
|
import eventDemo.business.event.projection.GameProjectionBus
|
||||||
import eventDemo.domain.event.projection.GameState
|
import eventDemo.business.event.projection.GameState
|
||||||
import eventDemo.libs.event.projection.Projection
|
import eventDemo.libs.event.projection.Projection
|
||||||
import io.github.oshai.kotlinlogging.KotlinLogging
|
import io.github.oshai.kotlinlogging.KotlinLogging
|
||||||
import io.github.oshai.kotlinlogging.withLoggingContext
|
import io.github.oshai.kotlinlogging.withLoggingContext
|
||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
package eventDemo.domain.notification
|
package eventDemo.business.notification
|
||||||
|
|
||||||
import eventDemo.configuration.serializer.UUIDSerializer
|
import eventDemo.configuration.serializer.UUIDSerializer
|
||||||
import eventDemo.libs.command.Command
|
import eventDemo.libs.command.Command
|
||||||
+1
-1
@@ -1,3 +1,3 @@
|
|||||||
package eventDemo.domain.notification
|
package eventDemo.business.notification
|
||||||
|
|
||||||
sealed interface CommandNotification : Notification
|
sealed interface CommandNotification : Notification
|
||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
package eventDemo.domain.notification
|
package eventDemo.business.notification
|
||||||
|
|
||||||
import eventDemo.configuration.serializer.UUIDSerializer
|
import eventDemo.configuration.serializer.UUIDSerializer
|
||||||
import eventDemo.libs.command.CommandId
|
import eventDemo.libs.command.CommandId
|
||||||
+2
-2
@@ -1,6 +1,6 @@
|
|||||||
package eventDemo.domain.notification
|
package eventDemo.business.notification
|
||||||
|
|
||||||
import eventDemo.domain.entity.Player
|
import eventDemo.business.entity.Player
|
||||||
import eventDemo.configuration.serializer.UUIDSerializer
|
import eventDemo.configuration.serializer.UUIDSerializer
|
||||||
import kotlinx.serialization.Serializable
|
import kotlinx.serialization.Serializable
|
||||||
import java.util.UUID
|
import java.util.UUID
|
||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
package eventDemo.domain.notification
|
package eventDemo.business.notification
|
||||||
|
|
||||||
import eventDemo.configuration.serializer.UUIDSerializer
|
import eventDemo.configuration.serializer.UUIDSerializer
|
||||||
import kotlinx.serialization.Serializable
|
import kotlinx.serialization.Serializable
|
||||||
+2
-2
@@ -1,6 +1,6 @@
|
|||||||
package eventDemo.domain.notification
|
package eventDemo.business.notification
|
||||||
|
|
||||||
import eventDemo.domain.entity.Player
|
import eventDemo.business.entity.Player
|
||||||
import eventDemo.configuration.serializer.UUIDSerializer
|
import eventDemo.configuration.serializer.UUIDSerializer
|
||||||
import kotlinx.serialization.Serializable
|
import kotlinx.serialization.Serializable
|
||||||
import java.util.UUID
|
import java.util.UUID
|
||||||
+3
-3
@@ -1,7 +1,7 @@
|
|||||||
package eventDemo.domain.notification
|
package eventDemo.business.notification
|
||||||
|
|
||||||
import eventDemo.domain.entity.Card
|
import eventDemo.business.entity.Card
|
||||||
import eventDemo.domain.entity.Player
|
import eventDemo.business.entity.Player
|
||||||
import eventDemo.configuration.serializer.UUIDSerializer
|
import eventDemo.configuration.serializer.UUIDSerializer
|
||||||
import kotlinx.serialization.Serializable
|
import kotlinx.serialization.Serializable
|
||||||
import java.util.UUID
|
import java.util.UUID
|
||||||
+2
-2
@@ -1,6 +1,6 @@
|
|||||||
package eventDemo.domain.notification
|
package eventDemo.business.notification
|
||||||
|
|
||||||
import eventDemo.domain.entity.Player
|
import eventDemo.business.entity.Player
|
||||||
import eventDemo.configuration.serializer.UUIDSerializer
|
import eventDemo.configuration.serializer.UUIDSerializer
|
||||||
import kotlinx.serialization.Serializable
|
import kotlinx.serialization.Serializable
|
||||||
import java.util.UUID
|
import java.util.UUID
|
||||||
+3
-3
@@ -1,7 +1,7 @@
|
|||||||
package eventDemo.domain.notification
|
package eventDemo.business.notification
|
||||||
|
|
||||||
import eventDemo.domain.entity.Card
|
import eventDemo.business.entity.Card
|
||||||
import eventDemo.domain.entity.Player
|
import eventDemo.business.entity.Player
|
||||||
import eventDemo.configuration.serializer.UUIDSerializer
|
import eventDemo.configuration.serializer.UUIDSerializer
|
||||||
import kotlinx.serialization.Serializable
|
import kotlinx.serialization.Serializable
|
||||||
import java.util.UUID
|
import java.util.UUID
|
||||||
+2
-2
@@ -1,6 +1,6 @@
|
|||||||
package eventDemo.domain.notification
|
package eventDemo.business.notification
|
||||||
|
|
||||||
import eventDemo.domain.entity.Player
|
import eventDemo.business.entity.Player
|
||||||
import eventDemo.configuration.serializer.UUIDSerializer
|
import eventDemo.configuration.serializer.UUIDSerializer
|
||||||
import kotlinx.serialization.Serializable
|
import kotlinx.serialization.Serializable
|
||||||
import java.util.UUID
|
import java.util.UUID
|
||||||
+2
-2
@@ -1,6 +1,6 @@
|
|||||||
package eventDemo.domain.notification
|
package eventDemo.business.notification
|
||||||
|
|
||||||
import eventDemo.domain.entity.Player
|
import eventDemo.business.entity.Player
|
||||||
import eventDemo.configuration.serializer.UUIDSerializer
|
import eventDemo.configuration.serializer.UUIDSerializer
|
||||||
import kotlinx.serialization.Serializable
|
import kotlinx.serialization.Serializable
|
||||||
import java.util.UUID
|
import java.util.UUID
|
||||||
+2
-2
@@ -1,6 +1,6 @@
|
|||||||
package eventDemo.domain.notification
|
package eventDemo.business.notification
|
||||||
|
|
||||||
import eventDemo.domain.entity.Card
|
import eventDemo.business.entity.Card
|
||||||
import eventDemo.configuration.serializer.UUIDSerializer
|
import eventDemo.configuration.serializer.UUIDSerializer
|
||||||
import kotlinx.serialization.Serializable
|
import kotlinx.serialization.Serializable
|
||||||
import java.util.UUID
|
import java.util.UUID
|
||||||
+2
-2
@@ -1,6 +1,6 @@
|
|||||||
package eventDemo.domain.notification
|
package eventDemo.business.notification
|
||||||
|
|
||||||
import eventDemo.domain.entity.Player
|
import eventDemo.business.entity.Player
|
||||||
import eventDemo.configuration.serializer.UUIDSerializer
|
import eventDemo.configuration.serializer.UUIDSerializer
|
||||||
import kotlinx.serialization.Serializable
|
import kotlinx.serialization.Serializable
|
||||||
import java.util.UUID
|
import java.util.UUID
|
||||||
+2
-2
@@ -1,6 +1,6 @@
|
|||||||
package eventDemo.domain.notification
|
package eventDemo.business.notification
|
||||||
|
|
||||||
import eventDemo.domain.entity.Card
|
import eventDemo.business.entity.Card
|
||||||
import eventDemo.configuration.serializer.UUIDSerializer
|
import eventDemo.configuration.serializer.UUIDSerializer
|
||||||
import kotlinx.serialization.Serializable
|
import kotlinx.serialization.Serializable
|
||||||
import java.util.UUID
|
import java.util.UUID
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
package eventDemo.configuration
|
package eventDemo.configuration
|
||||||
|
|
||||||
import eventDemo.configuration.domain.configureGameListener
|
import eventDemo.configuration.business.configureGameListener
|
||||||
import eventDemo.configuration.ktor.configureHttpRouting
|
import eventDemo.configuration.ktor.configureHttpRouting
|
||||||
import eventDemo.configuration.ktor.configureKoin
|
import eventDemo.configuration.ktor.configureKoin
|
||||||
import eventDemo.configuration.ktor.configureSecurity
|
import eventDemo.configuration.ktor.configureSecurity
|
||||||
|
|||||||
@@ -0,0 +1,21 @@
|
|||||||
|
package eventDemo.configuration.business
|
||||||
|
|
||||||
|
import eventDemo.adapter.infrastructureLayer.event.projection.GameListRepositoryInRedis
|
||||||
|
import eventDemo.adapter.infrastructureLayer.event.projection.GameStateRepositoryInRedis
|
||||||
|
import eventDemo.business.command.GameCommandHandler
|
||||||
|
import eventDemo.business.event.projection.projectionListener.ReactionListener
|
||||||
|
import org.koin.core.Koin
|
||||||
|
|
||||||
|
fun Koin.configureGameListener() {
|
||||||
|
get<GameCommandHandler>()
|
||||||
|
.subscribeToBus(get())
|
||||||
|
|
||||||
|
get<GameStateRepositoryInRedis>()
|
||||||
|
.subscribeToBus(get(), get())
|
||||||
|
|
||||||
|
get<GameListRepositoryInRedis>()
|
||||||
|
.subscribeToBus(get(), get())
|
||||||
|
|
||||||
|
get<ReactionListener>()
|
||||||
|
.subscribeToBus(get())
|
||||||
|
}
|
||||||
@@ -1,21 +0,0 @@
|
|||||||
package eventDemo.configuration.domain
|
|
||||||
|
|
||||||
import eventDemo.adapter.infrastructure.event.projection.GameListRepositoryInRedis
|
|
||||||
import eventDemo.adapter.infrastructure.event.projection.GameStateRepositoryInRedis
|
|
||||||
import eventDemo.domain.command.GameCommandHandler
|
|
||||||
import eventDemo.domain.event.projection.projectionListener.ReactionListener
|
|
||||||
import org.koin.core.Koin
|
|
||||||
|
|
||||||
fun Koin.configureGameListener() {
|
|
||||||
get<GameCommandHandler>()
|
|
||||||
.subscribeToBus(get())
|
|
||||||
|
|
||||||
get<GameStateRepositoryInRedis>()
|
|
||||||
.subscribeToBus(get(), get())
|
|
||||||
|
|
||||||
get<GameListRepositoryInRedis>()
|
|
||||||
.subscribeToBus(get(), get())
|
|
||||||
|
|
||||||
get<ReactionListener>()
|
|
||||||
.subscribeToBus(get())
|
|
||||||
}
|
|
||||||
@@ -1,9 +1,9 @@
|
|||||||
package eventDemo.configuration.injection
|
package eventDemo.configuration.injection
|
||||||
|
|
||||||
import eventDemo.domain.command.action.ICantPlay
|
import eventDemo.business.command.action.ICantPlay
|
||||||
import eventDemo.domain.command.action.IWantToJoinTheGame
|
import eventDemo.business.command.action.IWantToJoinTheGame
|
||||||
import eventDemo.domain.command.action.IWantToPlayCard
|
import eventDemo.business.command.action.IWantToPlayCard
|
||||||
import eventDemo.domain.command.action.IamReadyToPlay
|
import eventDemo.business.command.action.IamReadyToPlay
|
||||||
import org.koin.core.module.Module
|
import org.koin.core.module.Module
|
||||||
import org.koin.core.module.dsl.singleOf
|
import org.koin.core.module.dsl.singleOf
|
||||||
|
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
package eventDemo.configuration.injection
|
package eventDemo.configuration.injection
|
||||||
|
|
||||||
import eventDemo.domain.command.GameCommandActionRunner
|
import eventDemo.business.command.GameCommandActionRunner
|
||||||
import eventDemo.domain.command.GameCommandHandler
|
import eventDemo.business.command.GameCommandHandler
|
||||||
import eventDemo.domain.event.GameEventHandler
|
import eventDemo.business.event.GameEventHandler
|
||||||
import eventDemo.domain.event.projection.projectionListener.PlayerNotificationListener
|
import eventDemo.business.event.projection.projectionListener.PlayerNotificationListener
|
||||||
import eventDemo.domain.event.projection.projectionListener.ReactionListener
|
import eventDemo.business.event.projection.projectionListener.ReactionListener
|
||||||
import org.koin.core.module.Module
|
import org.koin.core.module.Module
|
||||||
import org.koin.core.module.dsl.singleOf
|
import org.koin.core.module.dsl.singleOf
|
||||||
|
|
||||||
|
|||||||
@@ -3,16 +3,16 @@ package eventDemo.configuration.injection
|
|||||||
import com.rabbitmq.client.ConnectionFactory
|
import com.rabbitmq.client.ConnectionFactory
|
||||||
import com.zaxxer.hikari.HikariConfig
|
import com.zaxxer.hikari.HikariConfig
|
||||||
import com.zaxxer.hikari.HikariDataSource
|
import com.zaxxer.hikari.HikariDataSource
|
||||||
import eventDemo.adapter.infrastructure.event.GameEventBusInRabbinMQ
|
import eventDemo.adapter.infrastructureLayer.event.GameEventBusInRabbinMQ
|
||||||
import eventDemo.adapter.infrastructure.event.GameEventStoreInPostgresql
|
import eventDemo.adapter.infrastructureLayer.event.GameEventStoreInPostgresql
|
||||||
import eventDemo.adapter.infrastructure.event.projection.GameListRepositoryInRedis
|
import eventDemo.adapter.infrastructureLayer.event.projection.GameListRepositoryInRedis
|
||||||
import eventDemo.adapter.infrastructure.event.projection.GameProjectionBusInRabbitMQ
|
import eventDemo.adapter.infrastructureLayer.event.projection.GameProjectionBusInRabbitMQ
|
||||||
import eventDemo.adapter.infrastructure.event.projection.GameStateRepositoryInRedis
|
import eventDemo.adapter.infrastructureLayer.event.projection.GameStateRepositoryInRedis
|
||||||
import eventDemo.domain.event.GameEventBus
|
import eventDemo.business.event.GameEventBus
|
||||||
import eventDemo.domain.event.GameEventStore
|
import eventDemo.business.event.GameEventStore
|
||||||
import eventDemo.domain.event.projection.GameListRepository
|
import eventDemo.business.event.projection.GameListRepository
|
||||||
import eventDemo.domain.event.projection.GameProjectionBus
|
import eventDemo.business.event.projection.GameProjectionBus
|
||||||
import eventDemo.domain.event.projection.GameStateRepository
|
import eventDemo.business.event.projection.GameStateRepository
|
||||||
import org.koin.core.module.Module
|
import org.koin.core.module.Module
|
||||||
import org.koin.core.module.dsl.singleOf
|
import org.koin.core.module.dsl.singleOf
|
||||||
import org.koin.core.scope.Scope
|
import org.koin.core.scope.Scope
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ package eventDemo.configuration.ktor
|
|||||||
|
|
||||||
import com.auth0.jwt.JWT
|
import com.auth0.jwt.JWT
|
||||||
import com.auth0.jwt.algorithms.Algorithm
|
import com.auth0.jwt.algorithms.Algorithm
|
||||||
import eventDemo.domain.entity.Player
|
import eventDemo.business.entity.Player
|
||||||
import io.ktor.http.HttpStatusCode
|
import io.ktor.http.HttpStatusCode
|
||||||
import io.ktor.server.application.Application
|
import io.ktor.server.application.Application
|
||||||
import io.ktor.server.auth.authentication
|
import io.ktor.server.auth.authentication
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
package eventDemo.configuration.ktor
|
package eventDemo.configuration.ktor
|
||||||
|
|
||||||
import eventDemo.domain.entity.GameId
|
import eventDemo.business.entity.GameId
|
||||||
import eventDemo.domain.entity.Player
|
import eventDemo.business.entity.Player
|
||||||
import eventDemo.configuration.serializer.CommandIdSerializer
|
import eventDemo.configuration.serializer.CommandIdSerializer
|
||||||
import eventDemo.configuration.serializer.GameIdSerializer
|
import eventDemo.configuration.serializer.GameIdSerializer
|
||||||
import eventDemo.configuration.serializer.PlayerIdSerializer
|
import eventDemo.configuration.serializer.PlayerIdSerializer
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
package eventDemo.configuration.route
|
package eventDemo.configuration.route
|
||||||
|
|
||||||
import eventDemo.adapter.presenter.query.readGamesList
|
import eventDemo.adapter.interfaceLayer.query.readGamesList
|
||||||
import eventDemo.adapter.presenter.query.readTheGameState
|
import eventDemo.adapter.interfaceLayer.query.readTheGameState
|
||||||
import io.ktor.server.application.Application
|
import io.ktor.server.application.Application
|
||||||
import io.ktor.server.routing.routing
|
import io.ktor.server.routing.routing
|
||||||
import org.koin.ktor.ext.get
|
import org.koin.ktor.ext.get
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
package eventDemo.configuration.route
|
package eventDemo.configuration.route
|
||||||
|
|
||||||
import eventDemo.adapter.presenter.query.gameWebSocket
|
import eventDemo.adapter.interfaceLayer.query.gameWebSocket
|
||||||
import eventDemo.domain.command.GameCommandHandler
|
import eventDemo.business.command.GameCommandHandler
|
||||||
import eventDemo.domain.event.projection.projectionListener.PlayerNotificationListener
|
import eventDemo.business.event.projection.projectionListener.PlayerNotificationListener
|
||||||
import io.ktor.server.application.Application
|
import io.ktor.server.application.Application
|
||||||
import io.ktor.server.routing.routing
|
import io.ktor.server.routing.routing
|
||||||
import kotlinx.coroutines.DelicateCoroutinesApi
|
import kotlinx.coroutines.DelicateCoroutinesApi
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
package eventDemo.configuration.serializer
|
package eventDemo.configuration.serializer
|
||||||
|
|
||||||
import eventDemo.domain.entity.GameId
|
import eventDemo.business.entity.GameId
|
||||||
import kotlinx.serialization.KSerializer
|
import kotlinx.serialization.KSerializer
|
||||||
import kotlinx.serialization.descriptors.PrimitiveKind
|
import kotlinx.serialization.descriptors.PrimitiveKind
|
||||||
import kotlinx.serialization.descriptors.PrimitiveSerialDescriptor
|
import kotlinx.serialization.descriptors.PrimitiveSerialDescriptor
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
package eventDemo.configuration.serializer
|
package eventDemo.configuration.serializer
|
||||||
|
|
||||||
import eventDemo.domain.entity.Player
|
import eventDemo.business.entity.Player
|
||||||
import kotlinx.serialization.KSerializer
|
import kotlinx.serialization.KSerializer
|
||||||
import kotlinx.serialization.descriptors.PrimitiveKind
|
import kotlinx.serialization.descriptors.PrimitiveKind
|
||||||
import kotlinx.serialization.descriptors.PrimitiveSerialDescriptor
|
import kotlinx.serialization.descriptors.PrimitiveSerialDescriptor
|
||||||
|
|||||||
@@ -1,27 +0,0 @@
|
|||||||
package eventDemo.domain.command
|
|
||||||
|
|
||||||
import eventDemo.domain.command.action.ICantPlay
|
|
||||||
import eventDemo.domain.command.action.IWantToJoinTheGame
|
|
||||||
import eventDemo.domain.command.action.IWantToPlayCard
|
|
||||||
import eventDemo.domain.command.action.IamReadyToPlay
|
|
||||||
import eventDemo.domain.command.command.GameCommand
|
|
||||||
import eventDemo.domain.command.command.ICantPlayCommand
|
|
||||||
import eventDemo.domain.command.command.IWantToJoinTheGameCommand
|
|
||||||
import eventDemo.domain.command.command.IWantToPlayCardCommand
|
|
||||||
import eventDemo.domain.command.command.IamReadyToPlayCommand
|
|
||||||
import eventDemo.domain.event.event.GameEvent
|
|
||||||
|
|
||||||
class GameCommandActionRunner(
|
|
||||||
private val iWantToPlayCard: IWantToPlayCard,
|
|
||||||
private val iamReadyToPlay: IamReadyToPlay,
|
|
||||||
private val iWantToJoinTheGame: IWantToJoinTheGame,
|
|
||||||
private val iCantPlay: ICantPlay,
|
|
||||||
) {
|
|
||||||
fun run(command: GameCommand): (version: Int) -> GameEvent =
|
|
||||||
when (command) {
|
|
||||||
is IWantToPlayCardCommand -> iWantToPlayCard.run(command)
|
|
||||||
is IamReadyToPlayCommand -> iamReadyToPlay.run(command)
|
|
||||||
is IWantToJoinTheGameCommand -> iWantToJoinTheGame.run(command)
|
|
||||||
is ICantPlayCommand -> iCantPlay.run(command)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
package eventDemo.domain.event
|
|
||||||
|
|
||||||
import eventDemo.domain.event.event.GameEvent
|
|
||||||
import eventDemo.libs.bus.Bus
|
|
||||||
|
|
||||||
interface GameEventBus : Bus<GameEvent>
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
package eventDemo.domain.event
|
|
||||||
|
|
||||||
import eventDemo.domain.entity.GameId
|
|
||||||
import eventDemo.domain.event.event.GameEvent
|
|
||||||
import eventDemo.libs.event.EventStore
|
|
||||||
|
|
||||||
interface GameEventStore : EventStore<GameEvent, GameId>
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
package eventDemo.domain.event.projection
|
|
||||||
|
|
||||||
import eventDemo.domain.entity.GameId
|
|
||||||
|
|
||||||
interface GameStateRepository {
|
|
||||||
fun get(gameId: GameId): GameState
|
|
||||||
}
|
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
package eventDemo.libs.command
|
package eventDemo.libs.command
|
||||||
|
|
||||||
import eventDemo.domain.command.CommandException
|
import eventDemo.business.command.CommandException
|
||||||
import eventDemo.domain.command.command.GameCommand
|
import eventDemo.business.command.command.GameCommand
|
||||||
import eventDemo.domain.event.event.GameEvent
|
import eventDemo.business.event.event.GameEvent
|
||||||
import eventDemo.libs.bus.Bus
|
import eventDemo.libs.bus.Bus
|
||||||
import eventDemo.libs.event.AggregateId
|
import eventDemo.libs.event.AggregateId
|
||||||
import eventDemo.libs.event.Event
|
import eventDemo.libs.event.Event
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
package eventDemo
|
package eventDemo
|
||||||
|
|
||||||
import com.zaxxer.hikari.HikariDataSource
|
import com.zaxxer.hikari.HikariDataSource
|
||||||
import eventDemo.domain.entity.Card
|
import eventDemo.business.entity.Card
|
||||||
import eventDemo.domain.entity.Deck
|
import eventDemo.business.entity.Deck
|
||||||
import eventDemo.configuration.domain.configureGameListener
|
import eventDemo.configuration.business.configureGameListener
|
||||||
import eventDemo.configuration.injection.appKoinModule
|
import eventDemo.configuration.injection.appKoinModule
|
||||||
import eventDemo.configuration.ktor.configuration
|
import eventDemo.configuration.ktor.configuration
|
||||||
import io.github.oshai.kotlinlogging.KotlinLogging
|
import io.github.oshai.kotlinlogging.KotlinLogging
|
||||||
|
|||||||
+8
-7
@@ -1,10 +1,12 @@
|
|||||||
package eventDemo.adapter.infrastructure.event
|
package eventDemo.adapter.infrastructureLayer
|
||||||
|
|
||||||
import com.rabbitmq.client.ConnectionFactory
|
import com.rabbitmq.client.ConnectionFactory
|
||||||
import eventDemo.domain.entity.GameId
|
import eventDemo.adapter.infrastructureLayer.event.GameEventBusInMemory
|
||||||
import eventDemo.domain.entity.Player
|
import eventDemo.adapter.infrastructureLayer.event.GameEventBusInRabbinMQ
|
||||||
import eventDemo.domain.event.GameEventBus
|
import eventDemo.business.entity.GameId
|
||||||
import eventDemo.domain.event.event.NewPlayerEvent
|
import eventDemo.business.entity.Player
|
||||||
|
import eventDemo.business.event.GameEventBus
|
||||||
|
import eventDemo.business.event.event.NewPlayerEvent
|
||||||
import eventDemo.testKoinApplicationWithConfig
|
import eventDemo.testKoinApplicationWithConfig
|
||||||
import io.kotest.assertions.nondeterministic.eventually
|
import io.kotest.assertions.nondeterministic.eventually
|
||||||
import io.kotest.core.spec.style.FunSpec
|
import io.kotest.core.spec.style.FunSpec
|
||||||
@@ -13,7 +15,6 @@ import io.kotest.matchers.equals.shouldBeEqual
|
|||||||
import io.mockk.mockk
|
import io.mockk.mockk
|
||||||
import io.mockk.spyk
|
import io.mockk.spyk
|
||||||
import io.mockk.verify
|
import io.mockk.verify
|
||||||
import java.util.function.Function
|
|
||||||
import kotlin.time.Duration.Companion.seconds
|
import kotlin.time.Duration.Companion.seconds
|
||||||
|
|
||||||
class GameEventBusInRabbitMQTest :
|
class GameEventBusInRabbitMQTest :
|
||||||
@@ -27,7 +28,7 @@ class GameEventBusInRabbitMQTest :
|
|||||||
)
|
)
|
||||||
|
|
||||||
withData(busListToTest) { bus ->
|
withData(busListToTest) { bus ->
|
||||||
val spy = spyk<() -> Unit>()
|
val spy = spyk(mockk<() -> Unit>())
|
||||||
val aggregateId = GameId()
|
val aggregateId = GameId()
|
||||||
val player1 = Player(name = "Tesla")
|
val player1 = Player(name = "Tesla")
|
||||||
val player2 = Player(name = "Einstein")
|
val player2 = Player(name = "Einstein")
|
||||||
+2
-2
@@ -1,6 +1,6 @@
|
|||||||
package eventDemo.adapter.presenter.query
|
package eventDemo.adapter.interfaceLayer.query
|
||||||
|
|
||||||
import eventDemo.domain.entity.Player
|
import eventDemo.business.entity.Player
|
||||||
import eventDemo.configuration.ktor.makeJwt
|
import eventDemo.configuration.ktor.makeJwt
|
||||||
import io.ktor.client.request.HttpRequestBuilder
|
import io.ktor.client.request.HttpRequestBuilder
|
||||||
import io.ktor.client.request.header
|
import io.ktor.client.request.header
|
||||||
+9
-9
@@ -1,12 +1,12 @@
|
|||||||
package eventDemo.adapter.presenter.query
|
package eventDemo.adapter.interfaceLayer.query
|
||||||
|
|
||||||
import eventDemo.domain.entity.GameId
|
import eventDemo.business.entity.GameId
|
||||||
import eventDemo.domain.entity.Player
|
import eventDemo.business.entity.Player
|
||||||
import eventDemo.domain.event.GameEventHandler
|
import eventDemo.business.event.GameEventHandler
|
||||||
import eventDemo.domain.event.event.GameStartedEvent
|
import eventDemo.business.event.event.GameStartedEvent
|
||||||
import eventDemo.domain.event.event.NewPlayerEvent
|
import eventDemo.business.event.event.NewPlayerEvent
|
||||||
import eventDemo.domain.event.event.PlayerReadyEvent
|
import eventDemo.business.event.event.PlayerReadyEvent
|
||||||
import eventDemo.domain.event.projection.GameList
|
import eventDemo.business.event.projection.GameList
|
||||||
import eventDemo.testApplicationWithConfig
|
import eventDemo.testApplicationWithConfig
|
||||||
import io.github.oshai.kotlinlogging.KotlinLogging
|
import io.github.oshai.kotlinlogging.KotlinLogging
|
||||||
import io.kotest.assertions.nondeterministic.eventually
|
import io.kotest.assertions.nondeterministic.eventually
|
||||||
@@ -57,7 +57,7 @@ class GameListRouteTest :
|
|||||||
},
|
},
|
||||||
) {
|
) {
|
||||||
// Wait until the projection is created
|
// Wait until the projection is created
|
||||||
eventually(10.seconds) {
|
eventually(3.seconds) {
|
||||||
httpClient()
|
httpClient()
|
||||||
.get("/games") {
|
.get("/games") {
|
||||||
withAuth(player1)
|
withAuth(player1)
|
||||||
+21
-21
@@ -1,26 +1,26 @@
|
|||||||
package eventDemo.adapter.presenter.query
|
package eventDemo.adapter.interfaceLayer.query
|
||||||
|
|
||||||
import eventDemo.Tag
|
import eventDemo.Tag
|
||||||
import eventDemo.domain.command.GameCommandHandler
|
import eventDemo.business.command.GameCommandHandler
|
||||||
import eventDemo.domain.command.command.GameCommand
|
import eventDemo.business.command.command.GameCommand
|
||||||
import eventDemo.domain.command.command.IWantToJoinTheGameCommand
|
import eventDemo.business.command.command.IWantToJoinTheGameCommand
|
||||||
import eventDemo.domain.command.command.IWantToPlayCardCommand
|
import eventDemo.business.command.command.IWantToPlayCardCommand
|
||||||
import eventDemo.domain.command.command.IamReadyToPlayCommand
|
import eventDemo.business.command.command.IamReadyToPlayCommand
|
||||||
import eventDemo.domain.entity.Card
|
import eventDemo.business.entity.Card
|
||||||
import eventDemo.domain.entity.GameId
|
import eventDemo.business.entity.GameId
|
||||||
import eventDemo.domain.entity.Player
|
import eventDemo.business.entity.Player
|
||||||
import eventDemo.domain.event.event.disableShuffleDeck
|
import eventDemo.business.event.event.disableShuffleDeck
|
||||||
import eventDemo.domain.event.projection.GameState
|
import eventDemo.business.event.projection.GameState
|
||||||
import eventDemo.domain.event.projection.GameStateRepository
|
import eventDemo.business.event.projection.GameStateRepository
|
||||||
import eventDemo.domain.event.projection.projectionListener.PlayerNotificationListener
|
import eventDemo.business.event.projection.projectionListener.PlayerNotificationListener
|
||||||
import eventDemo.domain.notification.CommandSuccessNotification
|
import eventDemo.business.notification.CommandSuccessNotification
|
||||||
import eventDemo.domain.notification.ItsTheTurnOfNotification
|
import eventDemo.business.notification.ItsTheTurnOfNotification
|
||||||
import eventDemo.domain.notification.Notification
|
import eventDemo.business.notification.Notification
|
||||||
import eventDemo.domain.notification.PlayerAsJoinTheGameNotification
|
import eventDemo.business.notification.PlayerAsJoinTheGameNotification
|
||||||
import eventDemo.domain.notification.PlayerAsPlayACardNotification
|
import eventDemo.business.notification.PlayerAsPlayACardNotification
|
||||||
import eventDemo.domain.notification.PlayerWasReadyNotification
|
import eventDemo.business.notification.PlayerWasReadyNotification
|
||||||
import eventDemo.domain.notification.TheGameWasStartedNotification
|
import eventDemo.business.notification.TheGameWasStartedNotification
|
||||||
import eventDemo.domain.notification.WelcomeToTheGameNotification
|
import eventDemo.business.notification.WelcomeToTheGameNotification
|
||||||
import eventDemo.testKoinApplicationWithConfig
|
import eventDemo.testKoinApplicationWithConfig
|
||||||
import io.kotest.assertions.nondeterministic.eventually
|
import io.kotest.assertions.nondeterministic.eventually
|
||||||
import io.kotest.assertions.nondeterministic.until
|
import io.kotest.assertions.nondeterministic.until
|
||||||
+11
-11
@@ -1,15 +1,15 @@
|
|||||||
package eventDemo.adapter.presenter.query
|
package eventDemo.adapter.interfaceLayer.query
|
||||||
|
|
||||||
import eventDemo.domain.entity.Card
|
import eventDemo.business.entity.Card
|
||||||
import eventDemo.domain.entity.GameId
|
import eventDemo.business.entity.GameId
|
||||||
import eventDemo.domain.entity.Player
|
import eventDemo.business.entity.Player
|
||||||
import eventDemo.domain.event.GameEventHandler
|
import eventDemo.business.event.GameEventHandler
|
||||||
import eventDemo.domain.event.event.CardIsPlayedEvent
|
import eventDemo.business.event.event.CardIsPlayedEvent
|
||||||
import eventDemo.domain.event.event.NewPlayerEvent
|
import eventDemo.business.event.event.NewPlayerEvent
|
||||||
import eventDemo.domain.event.event.PlayerReadyEvent
|
import eventDemo.business.event.event.PlayerReadyEvent
|
||||||
import eventDemo.domain.event.event.disableShuffleDeck
|
import eventDemo.business.event.event.disableShuffleDeck
|
||||||
import eventDemo.domain.event.projection.GameState
|
import eventDemo.business.event.projection.GameState
|
||||||
import eventDemo.domain.event.projection.GameStateRepository
|
import eventDemo.business.event.projection.GameStateRepository
|
||||||
import eventDemo.testApplicationWithConfig
|
import eventDemo.testApplicationWithConfig
|
||||||
import io.kotest.assertions.nondeterministic.eventually
|
import io.kotest.assertions.nondeterministic.eventually
|
||||||
import io.kotest.assertions.nondeterministic.until
|
import io.kotest.assertions.nondeterministic.until
|
||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
package eventDemo.adapter.presenter.query
|
package eventDemo.adapter.interfaceLayer.query
|
||||||
import eventDemo.configuration.ktor.defaultJsonSerializer
|
import eventDemo.configuration.ktor.defaultJsonSerializer
|
||||||
import io.ktor.client.HttpClient
|
import io.ktor.client.HttpClient
|
||||||
import io.ktor.client.plugins.contentnegotiation.ContentNegotiation
|
import io.ktor.client.plugins.contentnegotiation.ContentNegotiation
|
||||||
+9
-9
@@ -1,14 +1,14 @@
|
|||||||
package eventDemo.domain.command
|
package eventDemo.business.command
|
||||||
|
|
||||||
import eventDemo.Tag
|
import eventDemo.Tag
|
||||||
import eventDemo.domain.command.command.GameCommand
|
import eventDemo.business.command.command.GameCommand
|
||||||
import eventDemo.domain.command.command.IWantToJoinTheGameCommand
|
import eventDemo.business.command.command.IWantToJoinTheGameCommand
|
||||||
import eventDemo.domain.entity.GameId
|
import eventDemo.business.entity.GameId
|
||||||
import eventDemo.domain.entity.Player
|
import eventDemo.business.entity.Player
|
||||||
import eventDemo.domain.event.projection.projectionListener.PlayerNotificationListener
|
import eventDemo.business.event.projection.projectionListener.PlayerNotificationListener
|
||||||
import eventDemo.domain.notification.CommandSuccessNotification
|
import eventDemo.business.notification.CommandSuccessNotification
|
||||||
import eventDemo.domain.notification.Notification
|
import eventDemo.business.notification.Notification
|
||||||
import eventDemo.domain.notification.WelcomeToTheGameNotification
|
import eventDemo.business.notification.WelcomeToTheGameNotification
|
||||||
import eventDemo.testKoinApplicationWithConfig
|
import eventDemo.testKoinApplicationWithConfig
|
||||||
import io.kotest.core.spec.style.FunSpec
|
import io.kotest.core.spec.style.FunSpec
|
||||||
import io.kotest.matchers.collections.shouldContain
|
import io.kotest.matchers.collections.shouldContain
|
||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
package eventDemo.domain.command
|
package eventDemo.business.command
|
||||||
|
|
||||||
import io.kotest.core.spec.style.FunSpec
|
import io.kotest.core.spec.style.FunSpec
|
||||||
|
|
||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
package eventDemo.domain.command.command
|
package eventDemo.business.command.command
|
||||||
|
|
||||||
import io.kotest.core.spec.style.FunSpec
|
import io.kotest.core.spec.style.FunSpec
|
||||||
|
|
||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
package eventDemo.domain.command.command
|
package eventDemo.business.command.command
|
||||||
|
|
||||||
import io.kotest.core.spec.style.FunSpec
|
import io.kotest.core.spec.style.FunSpec
|
||||||
|
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user