docs: Migrationsplan für Projekt-Restrukturierung hinzugefügt
- Detaillierter Plan zur Migration von alter zu neuer Modulstruktur - Umfasst Überführung von shared-kernel zu core-Modulen - Definiert Migration von Fachdomänen zu bounded contexts: * master-data → masterdata-Module * member-management → members-Module * horse-registry → horses-Module * event-management → events-Module - Beschreibt Verlagerung von api-gateway zu infrastructure/gateway - Strukturiert nach Domain-driven Design Prinzipien - Berücksichtigt Clean Architecture Layering (domain, application, infrastructure, api)
This commit is contained in:
+32
-3
@@ -1,19 +1,48 @@
|
||||
package at.mocode.masterdata.domain.model
|
||||
|
||||
import at.mocode.core.domain.model.PlatzTypE
|
||||
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 einen Turnierplatz oder eine Wettkampfstätte.
|
||||
*
|
||||
* Diese Entität repräsentiert die verschiedenen Plätze und Arenen, die bei Turnieren
|
||||
* für verschiedene Disziplinen verwendet werden können.
|
||||
*
|
||||
* @property id Eindeutiger interner Identifikator für diesen Platz (UUID).
|
||||
* @property turnierId Fremdschlüssel zum Turnier, zu dem dieser Platz gehört.
|
||||
* @property name Der Name oder die Bezeichnung des Platzes (z.B. "Hauptplatz", "Dressurplatz A").
|
||||
* @property dimension Die Abmessungen des Platzes (z.B. "20x60m", "20x40m").
|
||||
* @property boden Die Art des Bodenbelags (z.B. "Sand", "Gras", "Kunststoff").
|
||||
* @property typ Der Typ des Platzes (siehe PlatzTypE enum).
|
||||
* @property istAktiv Gibt an, ob dieser Platz aktuell verwendet werden kann.
|
||||
* @property sortierReihenfolge Optionale Zahl zur Steuerung der Sortierreihenfolge.
|
||||
* @property createdAt Zeitstempel der Erstellung dieses Datensatzes.
|
||||
* @property updatedAt Zeitstempel der letzten Aktualisierung dieses Datensatzes.
|
||||
*/
|
||||
@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
|
||||
var dimension: String? = null,
|
||||
var boden: String? = null,
|
||||
var typ: PlatzTypE,
|
||||
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()
|
||||
)
|
||||
|
||||
+138
@@ -0,0 +1,138 @@
|
||||
package at.mocode.masterdata.domain.repository
|
||||
|
||||
import at.mocode.core.domain.model.SparteE
|
||||
import at.mocode.masterdata.domain.model.AltersklasseDefinition
|
||||
import com.benasher44.uuid.Uuid
|
||||
|
||||
/**
|
||||
* Repository interface for AltersklasseDefinition (Age Class) domain operations.
|
||||
*
|
||||
* This interface defines the contract for age class 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 AltersklasseRepository {
|
||||
|
||||
/**
|
||||
* Finds an age class by its unique ID.
|
||||
*
|
||||
* @param id The unique identifier of the age class
|
||||
* @return The age class if found, null otherwise
|
||||
*/
|
||||
suspend fun findById(id: Uuid): AltersklasseDefinition?
|
||||
|
||||
/**
|
||||
* Finds an age class by its code.
|
||||
*
|
||||
* @param altersklasseCode The age class code (e.g., "JGD_U16", "JUN_U18")
|
||||
* @return The age class if found, null otherwise
|
||||
*/
|
||||
suspend fun findByCode(altersklasseCode: String): AltersklasseDefinition?
|
||||
|
||||
/**
|
||||
* Finds age classes by name (partial match).
|
||||
*
|
||||
* @param searchTerm The search term to match against age class names
|
||||
* @param limit Maximum number of results to return
|
||||
* @return List of matching age classes
|
||||
*/
|
||||
suspend fun findByName(searchTerm: String, limit: Int = 50): List<AltersklasseDefinition>
|
||||
|
||||
/**
|
||||
* Finds all active age classes.
|
||||
*
|
||||
* @param sparteFilter Optional filter by sport type
|
||||
* @param geschlechtFilter Optional filter by gender ('M', 'W')
|
||||
* @return List of active age classes
|
||||
*/
|
||||
suspend fun findAllActive(sparteFilter: SparteE? = null, geschlechtFilter: Char? = null): List<AltersklasseDefinition>
|
||||
|
||||
/**
|
||||
* Finds age classes applicable for a specific age.
|
||||
*
|
||||
* @param age The age to check
|
||||
* @param sparteFilter Optional filter by sport type
|
||||
* @param geschlechtFilter Optional filter by gender ('M', 'W')
|
||||
* @return List of applicable age classes
|
||||
*/
|
||||
suspend fun findApplicableForAge(age: Int, sparteFilter: SparteE? = null, geschlechtFilter: Char? = null): List<AltersklasseDefinition>
|
||||
|
||||
/**
|
||||
* Finds age classes by sport type.
|
||||
*
|
||||
* @param sparte The sport type
|
||||
* @param activeOnly Whether to return only active age classes
|
||||
* @return List of age classes for the sport type
|
||||
*/
|
||||
suspend fun findBySparte(sparte: SparteE, activeOnly: Boolean = true): List<AltersklasseDefinition>
|
||||
|
||||
/**
|
||||
* Finds age classes by gender filter.
|
||||
*
|
||||
* @param geschlecht The gender ('M', 'W')
|
||||
* @param activeOnly Whether to return only active age classes
|
||||
* @return List of age classes for the gender
|
||||
*/
|
||||
suspend fun findByGeschlecht(geschlecht: Char, activeOnly: Boolean = true): List<AltersklasseDefinition>
|
||||
|
||||
/**
|
||||
* Finds age classes by age range.
|
||||
*
|
||||
* @param minAge Minimum age (inclusive)
|
||||
* @param maxAge Maximum age (inclusive)
|
||||
* @param activeOnly Whether to return only active age classes
|
||||
* @return List of age classes within the age range
|
||||
*/
|
||||
suspend fun findByAgeRange(minAge: Int?, maxAge: Int?, activeOnly: Boolean = true): List<AltersklasseDefinition>
|
||||
|
||||
/**
|
||||
* Finds age classes by OETO rule reference.
|
||||
*
|
||||
* @param oetoRegelReferenzId The OETO rule reference ID
|
||||
* @return List of age classes linked to the rule
|
||||
*/
|
||||
suspend fun findByOetoRegelReferenz(oetoRegelReferenzId: Uuid): List<AltersklasseDefinition>
|
||||
|
||||
/**
|
||||
* Saves an age class (create or update).
|
||||
*
|
||||
* @param altersklasse The age class to save
|
||||
* @return The saved age class with updated timestamps
|
||||
*/
|
||||
suspend fun save(altersklasse: AltersklasseDefinition): AltersklasseDefinition
|
||||
|
||||
/**
|
||||
* Deletes an age class by ID.
|
||||
*
|
||||
* @param id The unique identifier of the age class to delete
|
||||
* @return true if the age class was deleted, false if not found
|
||||
*/
|
||||
suspend fun delete(id: Uuid): Boolean
|
||||
|
||||
/**
|
||||
* Checks if an age class with the given code exists.
|
||||
*
|
||||
* @param altersklasseCode The age class code to check
|
||||
* @return true if an age class with this code exists, false otherwise
|
||||
*/
|
||||
suspend fun existsByCode(altersklasseCode: String): Boolean
|
||||
|
||||
/**
|
||||
* Counts the total number of active age classes.
|
||||
*
|
||||
* @param sparteFilter Optional filter by sport type
|
||||
* @return The total count of active age classes
|
||||
*/
|
||||
suspend fun countActive(sparteFilter: SparteE? = null): Long
|
||||
|
||||
/**
|
||||
* Validates if a person with given age and gender can participate in an age class.
|
||||
*
|
||||
* @param altersklasseId The age class ID
|
||||
* @param age The person's age
|
||||
* @param geschlecht The person's gender ('M', 'W')
|
||||
* @return true if the person can participate, false otherwise
|
||||
*/
|
||||
suspend fun isEligible(altersklasseId: Uuid, age: Int, geschlecht: Char): Boolean
|
||||
}
|
||||
+109
@@ -0,0 +1,109 @@
|
||||
package at.mocode.masterdata.domain.repository
|
||||
|
||||
import at.mocode.masterdata.domain.model.BundeslandDefinition
|
||||
import com.benasher44.uuid.Uuid
|
||||
|
||||
/**
|
||||
* Repository interface for BundeslandDefinition (Federal State) domain operations.
|
||||
*
|
||||
* This interface defines the contract for federal state 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 BundeslandRepository {
|
||||
|
||||
/**
|
||||
* Finds a federal state by its unique ID.
|
||||
*
|
||||
* @param id The unique identifier of the federal state
|
||||
* @return The federal state if found, null otherwise
|
||||
*/
|
||||
suspend fun findById(id: Uuid): BundeslandDefinition?
|
||||
|
||||
/**
|
||||
* Finds a federal state by its OEPS code.
|
||||
*
|
||||
* @param oepsCode The OEPS code (e.g., "01", "02")
|
||||
* @param landId The country ID to search within
|
||||
* @return The federal state if found, null otherwise
|
||||
*/
|
||||
suspend fun findByOepsCode(oepsCode: String, landId: Uuid): BundeslandDefinition?
|
||||
|
||||
/**
|
||||
* Finds a federal state by its ISO 3166-2 code.
|
||||
*
|
||||
* @param iso3166_2_Code The ISO 3166-2 code (e.g., "AT-1", "DE-BY")
|
||||
* @return The federal state if found, null otherwise
|
||||
*/
|
||||
suspend fun findByIso3166_2_Code(iso3166_2_Code: String): BundeslandDefinition?
|
||||
|
||||
/**
|
||||
* Finds all federal states for a specific country.
|
||||
*
|
||||
* @param landId The country ID
|
||||
* @param activeOnly Whether to return only active federal states
|
||||
* @param orderBySortierung Whether to order by sortierReihenfolge field
|
||||
* @return List of federal states for the country
|
||||
*/
|
||||
suspend fun findByCountry(landId: Uuid, activeOnly: Boolean = true, orderBySortierung: Boolean = true): List<BundeslandDefinition>
|
||||
|
||||
/**
|
||||
* Finds federal states by name (partial match).
|
||||
*
|
||||
* @param searchTerm The search term to match against federal state names
|
||||
* @param landId Optional country ID to limit search
|
||||
* @param limit Maximum number of results to return
|
||||
* @return List of matching federal states
|
||||
*/
|
||||
suspend fun findByName(searchTerm: String, landId: Uuid? = null, limit: Int = 50): List<BundeslandDefinition>
|
||||
|
||||
/**
|
||||
* Finds all active federal states.
|
||||
*
|
||||
* @param orderBySortierung Whether to order by sortierReihenfolge field
|
||||
* @return List of active federal states
|
||||
*/
|
||||
suspend fun findAllActive(orderBySortierung: Boolean = true): List<BundeslandDefinition>
|
||||
|
||||
/**
|
||||
* Saves a federal state (create or update).
|
||||
*
|
||||
* @param bundesland The federal state to save
|
||||
* @return The saved federal state with updated timestamps
|
||||
*/
|
||||
suspend fun save(bundesland: BundeslandDefinition): BundeslandDefinition
|
||||
|
||||
/**
|
||||
* Deletes a federal state by ID.
|
||||
*
|
||||
* @param id The unique identifier of the federal state to delete
|
||||
* @return true if the federal state was deleted, false if not found
|
||||
*/
|
||||
suspend fun delete(id: Uuid): Boolean
|
||||
|
||||
/**
|
||||
* Checks if a federal state with the given OEPS code exists for a country.
|
||||
*
|
||||
* @param oepsCode The OEPS code to check
|
||||
* @param landId The country ID
|
||||
* @return true if a federal state with this code exists, false otherwise
|
||||
*/
|
||||
suspend fun existsByOepsCode(oepsCode: String, landId: Uuid): Boolean
|
||||
|
||||
/**
|
||||
* Checks if a federal state with the given ISO 3166-2 code exists.
|
||||
*
|
||||
* @param iso3166_2_Code The ISO 3166-2 code to check
|
||||
* @return true if a federal state with this code exists, false otherwise
|
||||
*/
|
||||
suspend fun existsByIso3166_2_Code(iso3166_2_Code: String): Boolean
|
||||
|
||||
/**
|
||||
* Counts the total number of active federal states for a country.
|
||||
*
|
||||
* @param landId The country ID
|
||||
* @return The total count of active federal states
|
||||
*/
|
||||
suspend fun countActiveByCountry(landId: Uuid): Long
|
||||
}
|
||||
+150
@@ -0,0 +1,150 @@
|
||||
package at.mocode.masterdata.domain.repository
|
||||
|
||||
import at.mocode.core.domain.model.PlatzTypE
|
||||
import at.mocode.masterdata.domain.model.Platz
|
||||
import com.benasher44.uuid.Uuid
|
||||
|
||||
/**
|
||||
* Repository interface for Platz (Venue/Arena) domain operations.
|
||||
*
|
||||
* This interface defines the contract for venue/arena 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 PlatzRepository {
|
||||
|
||||
/**
|
||||
* Finds a venue by its unique ID.
|
||||
*
|
||||
* @param id The unique identifier of the venue
|
||||
* @return The venue if found, null otherwise
|
||||
*/
|
||||
suspend fun findById(id: Uuid): Platz?
|
||||
|
||||
/**
|
||||
* Finds all venues for a specific tournament.
|
||||
*
|
||||
* @param turnierId The tournament ID
|
||||
* @param activeOnly Whether to return only active venues
|
||||
* @param orderBySortierung Whether to order by sortierReihenfolge field
|
||||
* @return List of venues for the tournament
|
||||
*/
|
||||
suspend fun findByTournament(turnierId: Uuid, activeOnly: Boolean = true, orderBySortierung: Boolean = true): List<Platz>
|
||||
|
||||
/**
|
||||
* Finds venues by name (partial match).
|
||||
*
|
||||
* @param searchTerm The search term to match against venue names
|
||||
* @param turnierId Optional tournament ID to limit search
|
||||
* @param limit Maximum number of results to return
|
||||
* @return List of matching venues
|
||||
*/
|
||||
suspend fun findByName(searchTerm: String, turnierId: Uuid? = null, limit: Int = 50): List<Platz>
|
||||
|
||||
/**
|
||||
* Finds venues by type.
|
||||
*
|
||||
* @param typ The venue type
|
||||
* @param turnierId Optional tournament ID to limit search
|
||||
* @param activeOnly Whether to return only active venues
|
||||
* @return List of venues of the specified type
|
||||
*/
|
||||
suspend fun findByType(typ: PlatzTypE, turnierId: Uuid? = null, activeOnly: Boolean = true): List<Platz>
|
||||
|
||||
/**
|
||||
* Finds venues by ground type.
|
||||
*
|
||||
* @param boden The ground type (e.g., "Sand", "Gras", "Kunststoff")
|
||||
* @param turnierId Optional tournament ID to limit search
|
||||
* @param activeOnly Whether to return only active venues
|
||||
* @return List of venues with the specified ground type
|
||||
*/
|
||||
suspend fun findByGroundType(boden: String, turnierId: Uuid? = null, activeOnly: Boolean = true): List<Platz>
|
||||
|
||||
/**
|
||||
* Finds venues by dimensions.
|
||||
*
|
||||
* @param dimension The venue dimensions (e.g., "20x60m", "20x40m")
|
||||
* @param turnierId Optional tournament ID to limit search
|
||||
* @param activeOnly Whether to return only active venues
|
||||
* @return List of venues with the specified dimensions
|
||||
*/
|
||||
suspend fun findByDimensions(dimension: String, turnierId: Uuid? = null, activeOnly: Boolean = true): List<Platz>
|
||||
|
||||
/**
|
||||
* Finds all active venues.
|
||||
*
|
||||
* @param orderBySortierung Whether to order by sortierReihenfolge field
|
||||
* @return List of active venues
|
||||
*/
|
||||
suspend fun findAllActive(orderBySortierung: Boolean = true): List<Platz>
|
||||
|
||||
/**
|
||||
* Finds venues suitable for a specific discipline based on type and dimensions.
|
||||
*
|
||||
* @param requiredType The required venue type
|
||||
* @param requiredDimensions Optional required dimensions
|
||||
* @param turnierId Optional tournament ID to limit search
|
||||
* @return List of suitable venues
|
||||
*/
|
||||
suspend fun findSuitableForDiscipline(
|
||||
requiredType: PlatzTypE,
|
||||
requiredDimensions: String? = null,
|
||||
turnierId: Uuid? = null
|
||||
): List<Platz>
|
||||
|
||||
/**
|
||||
* Saves a venue (create or update).
|
||||
*
|
||||
* @param platz The venue to save
|
||||
* @return The saved venue with updated timestamps
|
||||
*/
|
||||
suspend fun save(platz: Platz): Platz
|
||||
|
||||
/**
|
||||
* Deletes a venue by ID.
|
||||
*
|
||||
* @param id The unique identifier of the venue to delete
|
||||
* @return true if the venue was deleted, false if not found
|
||||
*/
|
||||
suspend fun delete(id: Uuid): Boolean
|
||||
|
||||
/**
|
||||
* Checks if a venue with the given name exists for a tournament.
|
||||
*
|
||||
* @param name The venue name to check
|
||||
* @param turnierId The tournament ID
|
||||
* @return true if a venue with this name exists, false otherwise
|
||||
*/
|
||||
suspend fun existsByNameAndTournament(name: String, turnierId: Uuid): Boolean
|
||||
|
||||
/**
|
||||
* Counts the total number of active venues for a tournament.
|
||||
*
|
||||
* @param turnierId The tournament ID
|
||||
* @return The total count of active venues
|
||||
*/
|
||||
suspend fun countActiveByTournament(turnierId: Uuid): Long
|
||||
|
||||
/**
|
||||
* Counts venues by type for a tournament.
|
||||
*
|
||||
* @param typ The venue type
|
||||
* @param turnierId The tournament ID
|
||||
* @param activeOnly Whether to count only active venues
|
||||
* @return The count of venues of the specified type
|
||||
*/
|
||||
suspend fun countByTypeAndTournament(typ: PlatzTypE, turnierId: Uuid, activeOnly: Boolean = true): Long
|
||||
|
||||
/**
|
||||
* Finds available venues for a specific time slot (if scheduling is implemented).
|
||||
* This method can be extended when venue scheduling functionality is added.
|
||||
*
|
||||
* @param turnierId The tournament ID
|
||||
* @param startTime The start time (placeholder for future scheduling feature)
|
||||
* @param endTime The end time (placeholder for future scheduling feature)
|
||||
* @return List of available venues (currently returns all active venues)
|
||||
*/
|
||||
suspend fun findAvailableForTimeSlot(turnierId: Uuid, startTime: String? = null, endTime: String? = null): List<Platz>
|
||||
}
|
||||
Reference in New Issue
Block a user