Fix backend infrastructure issues for results-service, series-service, and events-service; integrate @EnableDiscoveryClient and Consul support; convert Series domain entities to data class; and update Gradle dependencies and configurations.

This commit is contained in:
Stefan Mogeritsch 2026-04-12 17:39:20 +02:00
parent c380537520
commit 62aaf6100e
14 changed files with 190 additions and 2 deletions

View File

@ -16,6 +16,10 @@ Versionierung folgt [Semantic Versioning](https://semver.org/lang/de/).
### [Unreleased]
### Hinzugefügt
- **Backend Fixes - 12.04.2026:**
- **Infrastruktur:** Behebung von Startfehlern im `events-service` (DataSource) und `masterdata-service` (Consul).
- **Build:** Integration von `results-service` und `series-service` in `settings.gradle.kts`.
- **Domain:** `Serie` und `SeriePunkt` zu `data class` konvertiert (copy() Unterstützung).
- **Phase 11 (Ergebniserfassung & Platzierung) - 12.04.2026:**
- **Backend (Results):** `results-service` um JPA-Entitäten, Repositories und Business-Logik für Platzierungsberechnungen (Wertnote, Zeit, Fehler) ergänzt.
- **Infrastructure:** `dc-backend.yaml` und `GatewayConfig.kt` um den Service `results` (Port 8088) erweitert.

View File

@ -30,6 +30,7 @@ dependencies {
implementation(libs.spring.boot.starter.web)
implementation(libs.spring.boot.starter.validation)
implementation(libs.spring.boot.starter.actuator)
implementation(libs.spring.cloud.starter.consul.discovery)
runtimeOnly(libs.postgresql.driver)

View File

@ -2,6 +2,7 @@ package at.mocode.events.service
import org.springframework.boot.autoconfigure.SpringBootApplication
import org.springframework.boot.runApplication
import org.springframework.cloud.client.discovery.EnableDiscoveryClient
/**
* Main application class for the Events Service.
@ -9,6 +10,7 @@ import org.springframework.boot.runApplication
* This service provides APIs for managing events and competitions.
*/
@SpringBootApplication
@EnableDiscoveryClient
class EventsServiceApplication
/**

View File

@ -0,0 +1,46 @@
spring:
application:
name: events-service
main:
banner-mode: "off"
datasource:
url: ${SPRING_DATASOURCE_URL:jdbc:postgresql://localhost:5432/pg-meldestelle-db}
username: ${SPRING_DATASOURCE_USERNAME:pg-user}
password: ${SPRING_DATASOURCE_PASSWORD:pg-password}
driver-class-name: org.postgresql.Driver
flyway:
enabled: true
baseline-on-migrate: true
cloud:
consul:
host: ${SPRING_CLOUD_CONSUL_HOST:localhost}
port: ${SPRING_CLOUD_CONSUL_PORT:8500}
enabled: ${CONSUL_ENABLED:true}
discovery:
enabled: ${CONSUL_ENABLED:true}
register: ${CONSUL_ENABLED:true}
health-check-path: /actuator/health
health-check-interval: 10s
instance-id: ${spring.application.name}-${server.port}-${random.uuid}
service-name: ${spring.application.name}
server:
port: 8085
management:
endpoints:
web:
exposure:
include: "health,info,metrics,prometheus"
endpoint:
health:
show-details: always
prometheus:
metrics:
export:
enabled: true
logging:
level:
root: INFO
at.mocode.events: DEBUG

View File

@ -2,6 +2,7 @@ package at.mocode.masterdata.service
import org.springframework.boot.autoconfigure.SpringBootApplication
import org.springframework.boot.runApplication
import org.springframework.cloud.client.discovery.EnableDiscoveryClient
/**
* Main application class for the Masterdata Service.
@ -9,6 +10,7 @@ import org.springframework.boot.runApplication
* This service provides APIs for managing master data such as countries, regions, and other reference data.
*/
@SpringBootApplication
@EnableDiscoveryClient
class MasterdataServiceApplication
fun main(args: Array<String>) {

View File

@ -18,6 +18,9 @@ dependencies {
implementation(libs.bundles.spring.boot.service.complete)
implementation(libs.postgresql.driver)
implementation(libs.spring.boot.starter.web)
implementation(libs.spring.boot.starter.data.jpa)
implementation(libs.spring.boot.starter.validation)
implementation(libs.spring.boot.starter.actuator)
// KORREKTUR: Jackson Bundle aufgelöst
implementation(libs.jackson.module.kotlin)

View File

@ -4,9 +4,11 @@ import at.mocode.results.service.application.ResultsService
import at.mocode.results.service.domain.Ergebnis
import org.springframework.boot.autoconfigure.SpringBootApplication
import org.springframework.boot.runApplication
import org.springframework.cloud.client.discovery.EnableDiscoveryClient
import org.springframework.web.bind.annotation.*
@SpringBootApplication
@EnableDiscoveryClient
class ResultsServiceApplication
fun main(args: Array<String>) {

View File

@ -0,0 +1,46 @@
spring:
application:
name: results-service
main:
banner-mode: "off"
datasource:
url: ${SPRING_DATASOURCE_URL:jdbc:postgresql://localhost:5432/pg-meldestelle-db}
username: ${SPRING_DATASOURCE_USERNAME:pg-user}
password: ${SPRING_DATASOURCE_PASSWORD:pg-password}
driver-class-name: org.postgresql.Driver
flyway:
enabled: true
baseline-on-migrate: true
cloud:
consul:
host: ${SPRING_CLOUD_CONSUL_HOST:localhost}
port: ${SPRING_CLOUD_CONSUL_PORT:8500}
enabled: ${CONSUL_ENABLED:true}
discovery:
enabled: ${CONSUL_ENABLED:true}
register: ${CONSUL_ENABLED:true}
health-check-path: /actuator/health
health-check-interval: 10s
instance-id: ${spring.application.name}-${server.port}-${random.uuid}
service-name: ${spring.application.name}
server:
port: 8088
management:
endpoints:
web:
exposure:
include: "health,info,metrics,prometheus"
endpoint:
health:
show-details: always
prometheus:
metrics:
export:
enabled: true
logging:
level:
root: INFO
at.mocode.results: DEBUG

View File

@ -18,6 +18,9 @@ dependencies {
implementation(libs.bundles.spring.boot.service.complete)
implementation(libs.postgresql.driver)
implementation(libs.spring.boot.starter.web)
implementation(libs.spring.boot.starter.data.jpa)
implementation(libs.spring.boot.starter.validation)
implementation(libs.spring.boot.starter.actuator)
// KORREKTUR: Jackson Bundle aufgelöst
implementation(libs.jackson.module.kotlin)

View File

@ -5,9 +5,11 @@ import at.mocode.series.service.domain.Serie
import at.mocode.series.service.domain.SeriePunkt
import org.springframework.boot.autoconfigure.SpringBootApplication
import org.springframework.boot.runApplication
import org.springframework.cloud.client.discovery.EnableDiscoveryClient
import org.springframework.web.bind.annotation.*
@SpringBootApplication
@EnableDiscoveryClient
class SeriesServiceApplication
fun main(args: Array<String>) {

View File

@ -5,7 +5,7 @@ import java.util.*
@Entity
@Table(name = "serien")
class Serie(
data class Serie(
@Id
val id: String = UUID.randomUUID().toString(),
@ -46,7 +46,7 @@ enum class Bindungstyp {
@Entity
@Table(name = "serie_punkte")
class SeriePunkt(
data class SeriePunkt(
@Id
val id: String = UUID.randomUUID().toString(),

View File

@ -0,0 +1,46 @@
spring:
application:
name: series-service
main:
banner-mode: "off"
datasource:
url: ${SPRING_DATASOURCE_URL:jdbc:postgresql://localhost:5432/pg-meldestelle-db}
username: ${SPRING_DATASOURCE_USERNAME:pg-user}
password: ${SPRING_DATASOURCE_PASSWORD:pg-password}
driver-class-name: org.postgresql.Driver
flyway:
enabled: true
baseline-on-migrate: true
cloud:
consul:
host: ${SPRING_CLOUD_CONSUL_HOST:localhost}
port: ${SPRING_CLOUD_CONSUL_PORT:8500}
enabled: ${CONSUL_ENABLED:true}
discovery:
enabled: ${CONSUL_ENABLED:true}
register: ${CONSUL_ENABLED:true}
health-check-path: /actuator/health
health-check-interval: 10s
instance-id: ${spring.application.name}-${server.port}-${random.uuid}
service-name: ${spring.application.name}
server:
port: 8089
management:
endpoints:
web:
exposure:
include: "health,info,metrics,prometheus"
endpoint:
health:
show-details: always
prometheus:
metrics:
export:
enabled: true
logging:
level:
root: INFO
at.mocode.series: DEBUG

View File

@ -0,0 +1,25 @@
# Curator Log - 2026-04-12 - Infrastruktur & Service-Fixes
## Status: Completed 🏗️
### Zusammenfassung
- Behebung von Startfehlern und Konfigurationsmängeln in der Backend-Infrastruktur.
- Integration neuer Services in das Build-System.
### Änderungen
#### Backend (Infrastruktur)
- **Settings:** `results-service` und `series-service` in `settings.gradle.kts` integriert.
- **Consul:** `@EnableDiscoveryClient` zu `MasterdataServiceApplication`, `ResultsServiceApplication`, `EventsServiceApplication` und `SeriesServiceApplication` hinzugefügt, um die Registrierung bei Consul sicherzustellen.
- **Konfiguration:** Fehlende `application.yml` Dateien für `events-service`, `results-service` und `series-service` erstellt. Dies behebt den `DataSource`-Konfigurationsfehler (PostgreSQL-Anbindung).
- **Abhängigkeiten:** `build.gradle.kts` des `events-service` um `spring-cloud-starter-consul-discovery` erweitert. `results` und `series` um JPA/Validation/Actuator Starter ergänzt.
#### Backend (Domain)
- **Series:** `Serie` und `SeriePunkt` Entitäten in `data class` umgewandelt, um die `copy()`-Methode für Business-Logik (Punkt-Zuweisung) verfügbar zu machen.
### Verifikation
- **Build:** Erfolgreiche Kompilierung aller betroffenen Services via Gradle (`:classes` Tasks für masterdata, events, results, series).
- **Konfiguration:** Syntaktische Prüfung der neuen YAML-Dateien auf korrekte Einrückung und Platzhalter.
- **DI/Spring:** Verifikation der `@EnableDiscoveryClient` Annotationen zur Laufzeit-Registrierung.
---
*Dokumentiert von Junie (AI Agent) am 12.04.2026*

View File

@ -106,6 +106,12 @@ include(":backend:services:ping:ping-service")
// --- ZNS-IMPORT (Asynchroner ZNS-Stammdaten-Import) ---
include(":backend:services:zns-import:zns-import-service")
// --- RESULTS (Ergebniserfassung & Platzierung) ---
include(":backend:services:results:results-service")
// --- SERIES (Cup- & Serienverwaltung) ---
include(":backend:services:series:series-service")
// ==========================================================================
// CORE
// ==========================================================================