feat(masterdata): introduce Reiter-Sparte persistence, services, and validations

- Added `ReiterSparteTable` to manage rider-discipline associations.
- Introduced services and tests for `LicenseMatrix`, `Altersklasse`, and `AbteilungsRegel` with domain logic and validations for ÖTO compliance.
- Enhanced `ExposedReiterRepository` to save and query `Reiter` disciplines efficiently.
- Implemented database migration script `V007__Cleanup_Initial_Tables_and_Add_Sparte.sql`.
- Updated `MasterdataDatabaseConfiguration` to include `ReiterSparteTable` in the schema initialization.
- Expanded test coverage with new cases for eligibility checks, age group determinations, and splitting regulations.

Signed-off-by: Stefan Mogeritsch <stefan.mo.co@gmail.com>
This commit is contained in:
2026-03-30 14:47:11 +02:00
parent e8757c5c32
commit d8c9d11adb
17 changed files with 871 additions and 41 deletions
@@ -42,7 +42,8 @@ class MasterdataDatabaseConfiguration {
LicenseTable,
RichtverfahrenTable,
GebuehrTable,
RegulationConfigTable
RegulationConfigTable,
ReiterSparteTable
)
log.info("Masterdata database schema initialized successfully")
}
@@ -87,7 +88,8 @@ class MasterdataTestDatabaseConfiguration {
LicenseTable,
RichtverfahrenTable,
GebuehrTable,
RegulationConfigTable
RegulationConfigTable,
ReiterSparteTable
)
log.info("Test masterdata database schema initialized successfully")
}
@@ -0,0 +1,35 @@
-- V007: Cleanup Initial Tables and Add ReiterSparte Table
-- Harmonisierung: Löschen der veralteten dom_person / dom_verein Tabellen aus V1
-- Hinzufügen der Zwischentabelle für Reiter-Sparten
-- Löschen der alten Tabellen (Daten wurden bereits in V006 in die neuen Tabellen migriert bzw. werden neu importiert)
-- Vorsicht: Da dies ein Greenfield-Projekt ist und der Fokus auf V26 liegt, ist ein sauberer Schnitt hier erlaubt.
DROP TABLE IF EXISTS dom_person CASCADE;
DROP TABLE IF EXISTS dom_verein CASCADE;
-- Erstellung der Reiter-Sparten Tabelle
CREATE TABLE IF NOT EXISTS reiter_sparte
(
id
UUID
PRIMARY
KEY,
reiter_id
UUID
NOT
NULL
REFERENCES
reiter
(
reiter_id
) ON DELETE CASCADE,
sparte VARCHAR
(
20
) NOT NULL,
created_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMP
WITH TIME ZONE NOT NULL DEFAULT CURRENT_TIMESTAMP
);
CREATE UNIQUE INDEX ux_reiter_sparte ON reiter_sparte (reiter_id, sparte);