refactor: Migrate from monolithic to modular architecture
- Restructure project into domain-specific modules (core, masterdata, members, horses, events, infrastructure) - Create shared client components in common-ui module - Implement CI/CD workflows with GitHub Actions - Consolidate documentation in docs directory - Remove deprecated modules and documentation files - Add cleanup and migration scripts for transition - Update README with new project structure and setup instructions
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
plugins {
|
||||
kotlin("jvm")
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation(projects.core.coreDomain)
|
||||
implementation(projects.core.coreUtils)
|
||||
testImplementation(projects.platform.platformTesting)
|
||||
}
|
||||
+59
@@ -0,0 +1,59 @@
|
||||
package at.mocode.masterdata.domain.model
|
||||
|
||||
import at.mocode.core.domain.model.SparteE // Optional, falls Altersklassen stark spartenspezifisch sind
|
||||
import at.mocode.core.domain.serialization.KotlinInstantSerializer
|
||||
import at.mocode.core.domain.serialization.UuidSerializer
|
||||
import com.benasher44.uuid.Uuid
|
||||
import com.benasher44.uuid.uuid4
|
||||
import kotlinx.datetime.Clock
|
||||
import kotlinx.datetime.Instant
|
||||
import kotlinx.serialization.Serializable
|
||||
|
||||
/**
|
||||
* Definiert eine spezifische Altersklasse für Teilnehmer (Reiter, Fahrer, Voltigierer)
|
||||
* oder ggf. auch für Pferde, basierend auf den Vorgaben der ÖTO oder anderer Regelwerke.
|
||||
*
|
||||
* Beispiele: "Jugend U16", "Junioren U18", "Junge Reiter U21", "Allgemeine Klasse",
|
||||
* "Pony Jugend U14", "Senioren Ü40".
|
||||
* Diese Definitionen dienen zur Überprüfung von Teilnahmeberechtigungen in Bewerben und Abteilungen.
|
||||
*
|
||||
* @property altersklasseId Eindeutiger interner Identifikator für diese Altersklassendefinition (UUID).
|
||||
* @property altersklasseCode Ein eindeutiges Kürzel oder Code für die Altersklasse
|
||||
* (z.B. "JGD_U16", "JUN_U18", "YR_U21", "AK", "PONY_U14"). Dient als fachlicher Schlüssel.
|
||||
* @property bezeichnung Die offizielle oder allgemein verständliche Bezeichnung der Altersklasse.
|
||||
* @property minAlter Das Mindestalter (Jahre, inklusive) für diese Altersklasse. `null`, wenn es keine Untergrenze gibt.
|
||||
* @property maxAlter Das Höchstalter (Jahre, inklusive) für diese Altersklasse. `null`, wenn es keine Obergrenze gibt.
|
||||
* @property stichtagRegelText Eine Beschreibung der Regel für den Stichtag zur Altersberechnung
|
||||
* (z.B. "31.12. des laufenden Kalenderjahres", "Geburtstag im laufenden Jahr").
|
||||
* @property sparteFilter Optionale Angabe, ob diese Altersklassendefinition nur für eine spezifische Sparte gilt.
|
||||
* @property geschlechtFilter Optionaler Filter für das Geschlecht ('M', 'W'), falls die Altersklasse geschlechtsspezifisch ist.
|
||||
* `null` bedeutet für alle Geschlechter gültig.
|
||||
* @property oetoRegelReferenzId Optionale Verknüpfung zu einer spezifischen Regel in der `OETORegelReferenz`-Tabelle,
|
||||
* die diese Altersklasse definiert.
|
||||
* @property istAktiv Gibt an, ob diese Altersklassendefinition aktuell im System verwendet werden kann.
|
||||
* @property createdAt Zeitstempel der Erstellung dieses Datensatzes.
|
||||
* @property updatedAt Zeitstempel der letzten Aktualisierung dieses Datensatzes.
|
||||
*/
|
||||
@Serializable
|
||||
data class AltersklasseDefinition(
|
||||
@Serializable(with = UuidSerializer::class)
|
||||
val altersklasseId: Uuid = uuid4(), // Interner Primärschlüssel
|
||||
|
||||
var altersklasseCode: String, // Fachlicher PK, z.B. "JGD_U16"
|
||||
var bezeichnung: String,
|
||||
var minAlter: Int? = null,
|
||||
var maxAlter: Int? = null,
|
||||
var stichtagRegelText: String? = "31.12. des laufenden Kalenderjahres", // Typischer Default
|
||||
var sparteFilter: SparteE? = null, // Ist diese Definition spartenspezifisch?
|
||||
var geschlechtFilter: Char? = null, // 'M', 'W', oder null für beide
|
||||
|
||||
@Serializable(with = UuidSerializer::class)
|
||||
var oetoRegelReferenzId: Uuid? = null, // FK zu OETORegelReferenz.oetoRegelReferenzId
|
||||
|
||||
var istAktiv: Boolean = true,
|
||||
|
||||
@Serializable(with = KotlinInstantSerializer::class)
|
||||
val createdAt: Instant = Clock.System.now(),
|
||||
@Serializable(with = KotlinInstantSerializer::class)
|
||||
var updatedAt: Instant = Clock.System.now()
|
||||
)
|
||||
+51
@@ -0,0 +1,51 @@
|
||||
package at.mocode.masterdata.domain.model
|
||||
|
||||
import at.mocode.core.domain.serialization.KotlinInstantSerializer
|
||||
import at.mocode.core.domain.serialization.UuidSerializer
|
||||
import com.benasher44.uuid.Uuid
|
||||
import com.benasher44.uuid.uuid4
|
||||
import kotlinx.datetime.Clock
|
||||
import kotlinx.datetime.Instant
|
||||
import kotlinx.serialization.Serializable
|
||||
|
||||
/**
|
||||
* Definiert ein Bundesland oder eine vergleichbare subnationale Verwaltungseinheit.
|
||||
*
|
||||
* Diese Entität ist primär für die österreichischen Bundesländer mit ihren OEPS-spezifischen
|
||||
* Codes gedacht, kann aber auch für Bundesländer/Regionen anderer Nationen erweitert werden.
|
||||
*
|
||||
* @property bundeslandId Eindeutiger interner Identifikator für dieses Bundesland (UUID).
|
||||
* @property landId Fremdschlüssel zur `LandDefinition`, dem dieses Bundesland angehört.
|
||||
* @property oepsCode Der 2-stellige numerische OEPS-Code für österreichische Bundesländer
|
||||
* (z.B. "01" für Wien, "02" für Niederösterreich). Sollte eindeutig sein für Land "Österreich".
|
||||
* @property iso3166_2_Code Optionaler offizieller ISO 3166-2 Code für das Bundesland
|
||||
* (z.B. "AT-1" für Burgenland, "DE-BY" für Bayern).
|
||||
* @property name Der offizielle Name des Bundeslandes.
|
||||
* @property kuerzel Ein gängiges Kürzel für das Bundesland (z.B. "NÖ", "W", "STMK").
|
||||
* @property wappenUrl Optionaler URL-Pfad zu einer Bilddatei des Bundeslandwappens.
|
||||
* @property istAktiv Gibt an, ob dieses Bundesland aktuell im System ausgewählt/verwendet werden kann.
|
||||
* @property sortierReihenfolge Optionale Zahl zur Steuerung der Sortierreihenfolge in Auswahllisten.
|
||||
* @property createdAt Zeitstempel der Erstellung dieses Datensatzes.
|
||||
* @property updatedAt Zeitstempel der letzten Aktualisierung dieses Datensatzes.
|
||||
*/
|
||||
@Serializable
|
||||
data class BundeslandDefinition(
|
||||
@Serializable(with = UuidSerializer::class)
|
||||
val bundeslandId: Uuid = uuid4(),
|
||||
|
||||
@Serializable(with = UuidSerializer::class)
|
||||
var landId: Uuid, // FK zu LandDefinition.landId
|
||||
|
||||
var oepsCode: String?, // z.B. "01", "02", ... für Österreich; eindeutig pro landId = Österreich
|
||||
var iso3166_2_Code: String?, // z.B. "AT-1", "DE-BY"; Eindeutig global oder pro Land?
|
||||
var name: String, // z.B. "Niederösterreich", "Bayern"
|
||||
var kuerzel: String? = null, // z.B. "NÖ", "BY"
|
||||
var wappenUrl: String? = null,
|
||||
var istAktiv: Boolean = true,
|
||||
var sortierReihenfolge: Int? = null,
|
||||
|
||||
@Serializable(with = KotlinInstantSerializer::class)
|
||||
val createdAt: Instant = Clock.System.now(),
|
||||
@Serializable(with = KotlinInstantSerializer::class)
|
||||
var updatedAt: Instant = Clock.System.now()
|
||||
)
|
||||
+51
@@ -0,0 +1,51 @@
|
||||
package at.mocode.masterdata.domain.model
|
||||
|
||||
import at.mocode.core.domain.serialization.KotlinInstantSerializer
|
||||
import at.mocode.core.domain.serialization.UuidSerializer
|
||||
import com.benasher44.uuid.Uuid
|
||||
import com.benasher44.uuid.uuid4
|
||||
import kotlinx.datetime.Clock
|
||||
import kotlinx.datetime.Instant
|
||||
import kotlinx.serialization.Serializable
|
||||
|
||||
/**
|
||||
* Definiert ein Land/eine Nation mit seinen offiziellen Codes und Bezeichnungen.
|
||||
*
|
||||
* Diese Entität dient als zentrale Referenz für Länder, die im System für
|
||||
* Nationalitäten von Personen, Vereinen oder für internationale Turniere relevant sind.
|
||||
*
|
||||
* @property landId Eindeutiger interner Identifikator für dieses Land (UUID).
|
||||
* @property isoAlpha2Code Der 2-stellige ISO 3166-1 Alpha-2 Code des Landes (z.B. "AT", "DE"). Sollte eindeutig sein.
|
||||
* @property isoAlpha3Code Der 3-stellige ISO 3166-1 Alpha-3 Code des Landes (z.B. "AUT", "DEU"). Sollte eindeutig sein.
|
||||
* @property isoNumerischerCode Optionaler 3-stelliger numerischer ISO 3166-1 Code des Landes (z.B. "040" für Österreich).
|
||||
* @property nameDeutsch Der offizielle deutsche Name des Landes.
|
||||
* @property nameEnglisch Der offizielle englische Name des Landes.
|
||||
* @property wappenUrl Optionaler URL-Pfad zu einer Bilddatei des Länderwappens oder der Flagge.
|
||||
* @property istEuMitglied Gibt an, ob das Land Mitglied der Europäischen Union ist.
|
||||
* @property istEwrMitglied Gibt an, ob das Land Mitglied des Europäischen Wirtschaftsraums ist.
|
||||
* @property istAktiv Gibt an, ob dieses Land aktuell im System ausgewählt/verwendet werden kann.
|
||||
* @property sortierReihenfolge Optionale Zahl zur Steuerung der Sortierreihenfolge in Auswahllisten.
|
||||
* @property createdAt Zeitstempel der Erstellung dieses Datensatzes.
|
||||
* @property updatedAt Zeitstempel der letzten Aktualisierung dieses Datensatzes.
|
||||
*/
|
||||
@Serializable
|
||||
data class LandDefinition(
|
||||
@Serializable(with = UuidSerializer::class)
|
||||
val landId: Uuid = uuid4(),
|
||||
|
||||
var isoAlpha2Code: String, // z.B. "AT" → Fachlicher PK oder Unique Constraint
|
||||
var isoAlpha3Code: String, // z.B. "AUT" -> Unique Constraint
|
||||
var isoNumerischerCode: String? = null, // z.B. "040"
|
||||
var nameDeutsch: String, // z.B. "Österreich"
|
||||
var nameEnglisch: String? = null, // z.B. "Austria"
|
||||
var wappenUrl: String? = null,
|
||||
var istEuMitglied: Boolean? = null,
|
||||
var istEwrMitglied: Boolean? = null, // Europäischer Wirtschaftsraum
|
||||
var istAktiv: Boolean = true,
|
||||
var sortierReihenfolge: Int? = null,
|
||||
|
||||
@Serializable(with = KotlinInstantSerializer::class)
|
||||
val createdAt: Instant = Clock.System.now(),
|
||||
@Serializable(with = KotlinInstantSerializer::class)
|
||||
var updatedAt: Instant = Clock.System.now()
|
||||
)
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
package at.mocode.masterdata.domain.model
|
||||
|
||||
import at.mocode.core.domain.model.PlatzTypE
|
||||
import at.mocode.core.domain.serialization.UuidSerializer
|
||||
import com.benasher44.uuid.Uuid
|
||||
import com.benasher44.uuid.uuid4
|
||||
import kotlinx.serialization.Serializable
|
||||
|
||||
@Serializable
|
||||
data class Platz(
|
||||
@Serializable(with = UuidSerializer::class)
|
||||
val id: Uuid = uuid4(),
|
||||
@Serializable(with = UuidSerializer::class)
|
||||
var turnierId: Uuid,
|
||||
var name: String,
|
||||
var dimension: String?,
|
||||
var boden: String?,
|
||||
var typ: PlatzTypE
|
||||
)
|
||||
+109
@@ -0,0 +1,109 @@
|
||||
package at.mocode.masterdata.domain.repository
|
||||
|
||||
import at.mocode.masterdata.domain.model.LandDefinition
|
||||
import com.benasher44.uuid.Uuid
|
||||
|
||||
/**
|
||||
* Repository interface for LandDefinition (Country) domain operations.
|
||||
*
|
||||
* This interface defines the contract for country data access operations
|
||||
* without depending on specific implementation details (database, etc.).
|
||||
* Following the hexagonal architecture pattern, this interface belongs
|
||||
* to the domain layer and will be implemented in the infrastructure layer.
|
||||
*/
|
||||
interface LandRepository {
|
||||
|
||||
/**
|
||||
* Finds a country by its unique ID.
|
||||
*
|
||||
* @param id The unique identifier of the country
|
||||
* @return The country if found, null otherwise
|
||||
*/
|
||||
suspend fun findById(id: Uuid): LandDefinition?
|
||||
|
||||
/**
|
||||
* Finds a country by its ISO Alpha-2 code.
|
||||
*
|
||||
* @param isoAlpha2Code The 2-letter ISO code (e.g., "AT", "DE")
|
||||
* @return The country if found, null otherwise
|
||||
*/
|
||||
suspend fun findByIsoAlpha2Code(isoAlpha2Code: String): LandDefinition?
|
||||
|
||||
/**
|
||||
* Finds a country by its ISO Alpha-3 code.
|
||||
*
|
||||
* @param isoAlpha3Code The 3-letter ISO code (e.g., "AUT", "DEU")
|
||||
* @return The country if found, null otherwise
|
||||
*/
|
||||
suspend fun findByIsoAlpha3Code(isoAlpha3Code: String): LandDefinition?
|
||||
|
||||
/**
|
||||
* Finds countries by name (partial match on German or English name).
|
||||
*
|
||||
* @param searchTerm The search term to match against country names
|
||||
* @param limit Maximum number of results to return
|
||||
* @return List of matching countries
|
||||
*/
|
||||
suspend fun findByName(searchTerm: String, limit: Int = 50): List<LandDefinition>
|
||||
|
||||
/**
|
||||
* Finds all active countries.
|
||||
*
|
||||
* @param orderBySortierung Whether to order by sortierReihenfolge field
|
||||
* @return List of active countries
|
||||
*/
|
||||
suspend fun findAllActive(orderBySortierung: Boolean = true): List<LandDefinition>
|
||||
|
||||
/**
|
||||
* Finds all EU member countries.
|
||||
*
|
||||
* @return List of EU member countries
|
||||
*/
|
||||
suspend fun findEuMembers(): List<LandDefinition>
|
||||
|
||||
/**
|
||||
* Finds all EWR (European Economic Area) member countries.
|
||||
*
|
||||
* @return List of EWR member countries
|
||||
*/
|
||||
suspend fun findEwrMembers(): List<LandDefinition>
|
||||
|
||||
/**
|
||||
* Saves a country (create or update).
|
||||
*
|
||||
* @param land The country to save
|
||||
* @return The saved country with updated timestamps
|
||||
*/
|
||||
suspend fun save(land: LandDefinition): LandDefinition
|
||||
|
||||
/**
|
||||
* Deletes a country by ID.
|
||||
*
|
||||
* @param id The unique identifier of the country to delete
|
||||
* @return true if the country was deleted, false if not found
|
||||
*/
|
||||
suspend fun delete(id: Uuid): Boolean
|
||||
|
||||
/**
|
||||
* Checks if a country with the given ISO Alpha-2 code exists.
|
||||
*
|
||||
* @param isoAlpha2Code The ISO Alpha-2 code to check
|
||||
* @return true if a country with this code exists, false otherwise
|
||||
*/
|
||||
suspend fun existsByIsoAlpha2Code(isoAlpha2Code: String): Boolean
|
||||
|
||||
/**
|
||||
* Checks if a country with the given ISO Alpha-3 code exists.
|
||||
*
|
||||
* @param isoAlpha3Code The ISO Alpha-3 code to check
|
||||
* @return true if a country with this code exists, false otherwise
|
||||
*/
|
||||
suspend fun existsByIsoAlpha3Code(isoAlpha3Code: String): Boolean
|
||||
|
||||
/**
|
||||
* Counts the total number of active countries.
|
||||
*
|
||||
* @return The total count of active countries
|
||||
*/
|
||||
suspend fun countActive(): Long
|
||||
}
|
||||
Reference in New Issue
Block a user