fixing Frontend Problem
This commit is contained in:
@@ -28,8 +28,8 @@ kotlin {
|
||||
|
||||
commonMain.dependencies {
|
||||
// Core dependencies (that aren't included in platform-dependencies)
|
||||
api(projects.core.coreUtils)
|
||||
api(projects.core.coreDomain)
|
||||
// Note: core-domain should NOT depend on core-utils to avoid circular dependencies
|
||||
// core-utils depends on core-domain, not the other way around
|
||||
|
||||
// Serialization and date-time for commonMain
|
||||
api(libs.kotlinx.serialization.json)
|
||||
|
||||
@@ -2,10 +2,10 @@ package at.mocode.core.domain
|
||||
|
||||
import at.mocode.core.domain.event.BaseDomainEvent
|
||||
import at.mocode.core.domain.model.*
|
||||
import com.benasher44.uuid.uuid4
|
||||
import kotlin.test.Test
|
||||
import kotlin.test.assertEquals
|
||||
import kotlin.test.assertNotNull
|
||||
import kotlin.uuid.Uuid
|
||||
|
||||
@OptIn(kotlin.time.ExperimentalTime::class)
|
||||
class BaseDomainEventTest {
|
||||
@@ -27,7 +27,7 @@ class BaseDomainEventTest {
|
||||
|
||||
@Test
|
||||
fun `secondary constructor generates id and timestamp`() {
|
||||
val aggId = AggregateId(uuid4())
|
||||
val aggId = AggregateId(Uuid.random())
|
||||
val ev = object : BaseDomainEvent(
|
||||
aggregateId = aggId,
|
||||
eventType = EventType("TestEvent"),
|
||||
@@ -43,8 +43,8 @@ class BaseDomainEventTest {
|
||||
|
||||
@Test
|
||||
fun `primary constructor uses provided id and timestamp`() {
|
||||
val aggId = AggregateId(uuid4())
|
||||
val eid = EventId(uuid4())
|
||||
val aggId = AggregateId(Uuid.random())
|
||||
val eid = EventId(Uuid.random())
|
||||
val ts = kotlin.time.Instant.parse("2025-01-01T00:00:00Z")
|
||||
val base = object : BaseDomainEvent(
|
||||
aggregateId = aggId,
|
||||
@@ -52,8 +52,8 @@ class BaseDomainEventTest {
|
||||
version = EventVersion(2),
|
||||
eventId = eid,
|
||||
timestamp = ts,
|
||||
correlationId = CorrelationId(uuid4()),
|
||||
causationId = CausationId(uuid4())
|
||||
correlationId = CorrelationId(Uuid.random()),
|
||||
causationId = CausationId(Uuid.random())
|
||||
) {}
|
||||
|
||||
assertEquals(eid, base.eventId)
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
package at.mocode.core.domain
|
||||
|
||||
import at.mocode.core.domain.serialization.*
|
||||
import com.benasher44.uuid.uuid4
|
||||
import kotlinx.datetime.LocalDate
|
||||
import kotlinx.datetime.LocalDateTime
|
||||
import kotlinx.datetime.LocalTime
|
||||
import kotlinx.serialization.json.Json
|
||||
import kotlin.test.Test
|
||||
import kotlin.test.assertEquals
|
||||
import kotlin.uuid.Uuid
|
||||
|
||||
@OptIn(kotlin.time.ExperimentalTime::class)
|
||||
class SerializersTest {
|
||||
@@ -22,7 +22,7 @@ class SerializersTest {
|
||||
|
||||
@Test
|
||||
fun `UUID roundtrip`() {
|
||||
val uuid = uuid4()
|
||||
val uuid = Uuid.random()
|
||||
val json = Json.encodeToString(UuidSerializer, uuid)
|
||||
val decoded = Json.decodeFromString(UuidSerializer, json)
|
||||
assertEquals(uuid, decoded)
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
// wie z.B. Konfigurations-Management, Datenbank-Verbindungen und Service Discovery.
|
||||
plugins {
|
||||
alias(libs.plugins.kotlinMultiplatform)
|
||||
alias(libs.plugins.kotlinSerialization)
|
||||
}
|
||||
|
||||
kotlin {
|
||||
@@ -23,9 +24,16 @@ kotlin {
|
||||
}
|
||||
|
||||
sourceSets {
|
||||
all {
|
||||
languageSettings.optIn("kotlin.uuid.ExperimentalUuidApi")
|
||||
}
|
||||
|
||||
commonMain.dependencies {
|
||||
// Dependency on core-domain module to use its types
|
||||
// Domain models and types (core-utils depends on core-domain, not vice versa)
|
||||
api(projects.core.coreDomain)
|
||||
|
||||
api(libs.kotlinx.serialization.json)
|
||||
api(libs.kotlinx.datetime)
|
||||
// Async support (available for all platforms)
|
||||
api(libs.kotlinx.coroutines.core)
|
||||
// Utilities (multiplatform compatible)
|
||||
|
||||
Reference in New Issue
Block a user