fixing Frontend Problem

This commit is contained in:
2025-10-08 16:00:51 +02:00
parent 81086634f6
commit e34a444373
7 changed files with 129 additions and 21 deletions
+2 -2
View File
@@ -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)