refactor(core): Unify components and adopt standard tooling

This commit performs several key refactorings within the `core`-module to improve consistency, stability, and adhere to industry best practices.

1.  **Unify `Result` Type:**
    Removed the specialized `Result<T>` class from `core-utils`. The entire system will now exclusively use the more flexible and type-safe `Result<T, E>` from `core-domain`. This allows for explicit, non-exception-based error handling for business logic.

2.  **Adopt Flyway for Database Migrations:**
    Replaced the custom `DatabaseMigrator.kt` implementation with the industry-standard tool Flyway. The `DatabaseFactory` now triggers Flyway migrations on application startup. This provides more robust, transactional, and feature-rich schema management.

3.  **Cleanup and Housekeeping:**
    - Removed obsolete test files related to the old migrator.
    - Ensured all components align with the new unified patterns.

BREAKING CHANGE: The `at.mocode.core.utils.error.Result` class has been removed. All modules must be updated to use the `at.mocode.core.domain.error.Result` type. The custom migrator is no longer available.

Closes #ISSUE_NUMBER_FOR_REFACTORING
This commit is contained in:
2025-07-28 22:43:28 +02:00
parent ca4d476360
commit 260460149a
13 changed files with 477 additions and 699 deletions
+10 -11
View File
@@ -1,31 +1,30 @@
plugins {
kotlin("jvm")
alias(libs.plugins.kotlin.serialization)
}
dependencies {
api(projects.platform.platformDependencies)
// UUID handling
api("com.benasher44:uuid:0.8.2")
// Explizite `api`-Abhängigkeit zum core-domain Modul.
api(projects.core.coreDomain)
// Serialization
api("org.jetbrains.kotlinx:kotlinx-serialization-json")
api("org.jetbrains.kotlinx:kotlinx-datetime")
// --- Coroutines & Asynchronität ---
api("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.7.3")
// Database
// --- Datenbank-Management ---
api("org.jetbrains.exposed:exposed-core")
api("org.jetbrains.exposed:exposed-dao")
api("org.jetbrains.exposed:exposed-jdbc")
api("org.jetbrains.exposed:exposed-kotlin-datetime")
api("com.zaxxer:HikariCP")
// Flyway Core-Bibliothek
api("org.flywaydb:flyway-core:9.22.3")
// KORREKTUR: Spezifischer Treiber für PostgreSQL mit Versionsnummer
api("org.flywaydb:flyway-database-postgresql:9.22.3")
// BigDecimal
api("com.ionspin.kotlin:bignum:0.3.8")
// Service Discovery
// --- Service Discovery ---
api("com.orbitz.consul:consul-client:1.5.3")
// --- Testing ---
testImplementation(projects.platform.platformTesting)
}