refactoring: Masive refactor to build the V2
Tests / lint (push) Has been cancelled
Tests / test (push) Has been cancelled
Tests / build (push) Has been cancelled

This commit is contained in:
2026-07-30 22:42:56 +02:00
parent b313b39cf4
commit 3c85c344ce
260 changed files with 5039 additions and 4744 deletions
@@ -0,0 +1,31 @@
package eventDemo.contexts.game.domain.events
import eventDemo.contexts.game.domain.game.Card
import eventDemo.contexts.game.domain.game.Card.Color
import eventDemo.contexts.game.domain.game.GameId
import eventDemo.contexts.game.domain.game.Player
import eventDemo.contexts.game.infrastructure.persistence.serializers.EventIdSerializer
import eventDemo.libs.eventSource.EventId
import kotlinx.datetime.Clock
import kotlinx.datetime.Instant
import kotlinx.serialization.Serializable
import java.util.UUID
/**
* An [GameEvent] to represent a played card.
*/
@Serializable
data class CardIsPlayedEvent(
override val aggregateId: GameId,
val card: Card,
override val playerId: Player.PlayerId,
val chosenColor: Color? = null,
override val version: Int,
) : GameEvent,
PlayerActionEvent {
@Serializable(with = EventIdSerializer::class)
override val eventId: EventId = EventId(UUID.randomUUID())
override val createdAt: Instant = Clock.System.now()
val theColorCard get() = if (card is Card.CardWithColor) card.color else chosenColor
}