### feat: verbessere DTO-Handling und füge Feature-Flag hinzu

- **NennungViewModel:** Definiere lokales `NennungDto` zur Optimierung der Backend-Response-Verarbeitung.
- **MailPollingService:** Ergänze Bedingung für Scheduler-Aktivierung (`ConditionalOnProperty`).
- **.env & application.yaml:** Füge `MAIL_POLLING_ENABLED` als Feature-Flag hinzu.
- **Dependencies:** Refaktor Import-Reihenfolge für Konsistenz.
This commit is contained in:
2026-04-22 20:26:59 +02:00
parent 8b44edda90
commit 309834d90c
5 changed files with 34 additions and 5 deletions
@@ -1,9 +1,8 @@
package at.mocode.frontend.features.nennung.presentation
import at.mocode.frontend.features.nennung.domain.*
import androidx.lifecycle.ViewModel
import androidx.lifecycle.viewModelScope
import at.mocode.frontend.features.nennung.presentation.web.NennungDto
import at.mocode.frontend.features.nennung.domain.*
import io.ktor.client.*
import io.ktor.client.call.*
import io.ktor.client.request.*
@@ -50,6 +49,18 @@ class NennungViewModel : ViewModel(), KoinComponent {
viewModelScope.launch {
_uiState.update { it.copy(isOnlineLoading = true) }
try {
// Lokales, schlankes DTO passend zur Backend-Response (MailController → NennungEntity)
data class NennungDto(
val id: String?,
val vorname: String,
val nachname: String,
val lizenz: String,
val pferdName: String,
val pferdAlter: String,
val email: String,
val bewerbe: String
)
val dtos: List<NennungDto> = apiClient.get("/api/mail/nennungen").body()
val mapped = dtos.map { dto ->
OnlineNennung(