feat(horses-service): remove integration tests and obsolete configurations
- Deleted outdated integration test classes (`HorseServiceIntegrationTest`, `TransactionalContextTest`, and others) and test resources (`logback-test.xml`). - Removed obsolete Gradle dependencies related to these tests and revised project module references. - Simplified `DomPferd` domain model with minor refactorings for serialization and validation. Signed-off-by: Stefan Mogeritsch <stefan.mo.co@gmail.com>
This commit is contained in:
+7
-5
@@ -6,6 +6,7 @@ import at.mocode.core.domain.model.PferdeGeschlechtE
|
||||
import at.mocode.core.domain.serialization.KotlinInstantSerializer
|
||||
import at.mocode.core.domain.serialization.UuidSerializer
|
||||
import kotlinx.datetime.LocalDate
|
||||
import kotlinx.datetime.number
|
||||
import kotlinx.datetime.todayIn
|
||||
import kotlinx.serialization.Serializable
|
||||
import kotlin.time.Clock
|
||||
@@ -22,7 +23,7 @@ import kotlin.uuid.Uuid
|
||||
* @property pferdId Unique internal identifier for this horse (UUID).
|
||||
* @property pferdeName Name of the horse.
|
||||
* @property geschlecht Gender of the horse (Hengst, Stute, Wallach).
|
||||
* @property geburtsdatum Birth date of the horse.
|
||||
* @property geburtsdatum Birthdate of the horse.
|
||||
* @property rasse Breed of the horse.
|
||||
* @property farbe Color/coat of the horse.
|
||||
* @property besitzerId ID of the current owner (Person from member-management context).
|
||||
@@ -132,9 +133,10 @@ data class DomPferd(
|
||||
val today = kotlin.time.Clock.System.todayIn(kotlinx.datetime.TimeZone.currentSystemDefault())
|
||||
var age = today.year - birthDate.year
|
||||
|
||||
// Check if birthday has occurred this year
|
||||
if (today.monthNumber < birthDate.monthNumber ||
|
||||
(today.monthNumber == birthDate.monthNumber && today.dayOfMonth < birthDate.dayOfMonth)) {
|
||||
// Check if a birthday has occurred this year
|
||||
if (today.month.number < birthDate.month.number ||
|
||||
(today.month.number == birthDate.month.number && today.day < birthDate.day)
|
||||
) {
|
||||
age--
|
||||
}
|
||||
|
||||
@@ -164,7 +166,7 @@ data class DomPferd(
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a copy of this horse with updated timestamp.
|
||||
* Creates a copy of this horse with an updated timestamp.
|
||||
*/
|
||||
fun withUpdatedTimestamp(): DomPferd {
|
||||
return this.copy(updatedAt = kotlin.time.Clock.System.now())
|
||||
|
||||
Reference in New Issue
Block a user