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 19:15:20 +02:00
parent da5fd6fbff
commit ca4d476360
4 changed files with 186 additions and 728 deletions
@@ -0,0 +1,33 @@
-- File: V1__Create_Initial_Tables.sql
-- Tabelle zur Verwaltung der Vereine (Mandanten)
CREATE TABLE IF NOT EXISTS dom_verein (
verein_id UUID PRIMARY KEY,
oeps_vereins_nr VARCHAR(4) UNIQUE,
name VARCHAR(100) NOT NULL,
kuerzel VARCHAR(20),
bundesland_code VARCHAR(2),
daten_quelle VARCHAR(50) NOT NULL,
ist_aktiv BOOLEAN NOT NULL DEFAULT true,
created_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT CURRENT_TIMESTAMP
);
-- Tabelle zur Verwaltung der Personen (Sportler, Funktionäre)
CREATE TABLE IF NOT EXISTS dom_person (
person_id UUID PRIMARY KEY,
oeps_satz_nr VARCHAR(6) UNIQUE,
nachname VARCHAR(100) NOT NULL,
vorname VARCHAR(100) NOT NULL,
geburtsdatum DATE,
geschlecht VARCHAR(10),
nationalitaet_code VARCHAR(3),
stamm_verein_id UUID REFERENCES dom_verein(verein_id),
ist_gesperrt BOOLEAN NOT NULL DEFAULT false,
daten_quelle VARCHAR(50) NOT NULL,
ist_aktiv BOOLEAN NOT NULL DEFAULT true,
created_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT CURRENT_TIMESTAMP
);
-- Weitere Tabellen können hier hinzugefügt werden...