From e1514cfbce64450e9e5a19b2a235a5ca598db6cc Mon Sep 17 00:00:00 2001 From: Stefan Mogeritsch Date: Mon, 23 Mar 2026 15:22:14 +0100 Subject: [PATCH] refactor(horses-domain): replace `kotlin.time.Clock` with `Clock` in `DomPferd` - Updated `getAge()` and `withUpdatedTimestamp()` to use `Clock.System` directly. - Simplifies imports and aligns with existing kotlinx.datetime standards. Signed-off-by: Stefan Mogeritsch --- .../src/main/kotlin/at/mocode/horses/domain/model/DomPferd.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/services/horses/horses-domain/src/main/kotlin/at/mocode/horses/domain/model/DomPferd.kt b/backend/services/horses/horses-domain/src/main/kotlin/at/mocode/horses/domain/model/DomPferd.kt index e9d1dbfe..5e97c8ad 100644 --- a/backend/services/horses/horses-domain/src/main/kotlin/at/mocode/horses/domain/model/DomPferd.kt +++ b/backend/services/horses/horses-domain/src/main/kotlin/at/mocode/horses/domain/model/DomPferd.kt @@ -130,7 +130,7 @@ data class DomPferd( */ fun getAge(): Int? { return geburtsdatum?.let { birthDate -> - val today = kotlin.time.Clock.System.todayIn(kotlinx.datetime.TimeZone.currentSystemDefault()) + val today = Clock.System.todayIn(kotlinx.datetime.TimeZone.currentSystemDefault()) var age = today.year - birthDate.year // Check if a birthday has occurred this year @@ -169,6 +169,6 @@ data class DomPferd( * Creates a copy of this horse with an updated timestamp. */ fun withUpdatedTimestamp(): DomPferd { - return this.copy(updatedAt = kotlin.time.Clock.System.now()) + return this.copy(updatedAt = Clock.System.now()) } }