fixing gradle build
This commit is contained in:
@@ -5,14 +5,18 @@ plugins {
|
||||
alias(libs.plugins.kotlin.serialization)
|
||||
}
|
||||
|
||||
kotlin {
|
||||
compilerOptions {
|
||||
freeCompilerArgs.add("-Xopt-in=kotlin.time.ExperimentalTime")
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
// Stellt sicher, dass dieses Modul Zugriff auf die im zentralen Katalog
|
||||
// definierten Bibliotheken hat.
|
||||
api(projects.platform.platformDependencies)
|
||||
|
||||
// Kern-Abhängigkeiten für das Domänen-Modell.
|
||||
// `api` wird verwendet, damit Services, die `core-domain` einbinden,
|
||||
// diese Typen ebenfalls direkt nutzen können.
|
||||
// Kern-Abhängigkeiten für das Domänen-Modul.
|
||||
api(libs.uuid)
|
||||
api(libs.kotlinx.serialization.json)
|
||||
api(libs.kotlinx.datetime)
|
||||
|
||||
@@ -2,8 +2,9 @@ package at.mocode.core.domain.event
|
||||
|
||||
import com.benasher44.uuid.Uuid
|
||||
import com.benasher44.uuid.uuid4
|
||||
import kotlinx.datetime.Clock
|
||||
import kotlinx.datetime.Instant
|
||||
import java.util.UUID
|
||||
import kotlin.time.Clock
|
||||
import kotlin.time.Instant
|
||||
|
||||
/**
|
||||
* Base interface for all domain events in the system.
|
||||
@@ -12,9 +13,9 @@ import kotlinx.datetime.Instant
|
||||
interface DomainEvent {
|
||||
val eventId: Uuid
|
||||
val aggregateId: Uuid
|
||||
val eventType: String
|
||||
val eventType: java.time.Instant
|
||||
val timestamp: Instant
|
||||
val version: Long
|
||||
val version: Int
|
||||
|
||||
// OPTIMIZED: Added correlation and causation IDs for distributed tracing.
|
||||
/**
|
||||
@@ -33,8 +34,8 @@ interface DomainEvent {
|
||||
*/
|
||||
abstract class BaseDomainEvent(
|
||||
override val aggregateId: Uuid,
|
||||
override val eventType: String,
|
||||
override val version: Long,
|
||||
override val eventType: java.time.Instant,
|
||||
override val version: Int,
|
||||
override val eventId: Uuid = uuid4(),
|
||||
override val timestamp: Instant = Clock.System.now(),
|
||||
override val correlationId: Uuid? = null,
|
||||
|
||||
@@ -3,8 +3,8 @@ package at.mocode.core.domain.model
|
||||
import at.mocode.core.domain.serialization.KotlinInstantSerializer
|
||||
import at.mocode.core.domain.serialization.UuidSerializer
|
||||
import com.benasher44.uuid.Uuid
|
||||
import kotlinx.datetime.Clock
|
||||
import kotlinx.datetime.Instant
|
||||
import kotlin.time.Clock
|
||||
import kotlin.time.Instant
|
||||
import kotlinx.serialization.Serializable
|
||||
|
||||
/**
|
||||
@@ -49,7 +49,8 @@ data class ErrorDto(
|
||||
data class ApiResponse<T>(
|
||||
val data: T?,
|
||||
val success: Boolean,
|
||||
val errors: List<ErrorDto> = emptyList(), // OPTIMIZED: Using structured ErrorDto
|
||||
val errors: List<ErrorDto> = emptyList(),
|
||||
@Serializable(with = KotlinInstantSerializer::class)
|
||||
val timestamp: Instant = Clock.System.now()
|
||||
) {
|
||||
companion object {
|
||||
|
||||
@@ -2,7 +2,7 @@ package at.mocode.core.domain.serialization
|
||||
|
||||
import com.benasher44.uuid.Uuid
|
||||
import com.benasher44.uuid.uuidFrom
|
||||
import kotlinx.datetime.Instant
|
||||
import kotlin.time.Instant
|
||||
import kotlinx.datetime.LocalDate
|
||||
import kotlinx.datetime.LocalDateTime
|
||||
import kotlinx.datetime.LocalTime
|
||||
|
||||
Reference in New Issue
Block a user