chore: integriere Logo-Upload und Vorschau in Veranstalter-Wizard, verbessere Navigationslogik und erweitere Datenmodelle

Signed-off-by: StefanMoCoAt <stefan.mo.co@gmail.com>
This commit is contained in:
2026-04-21 15:16:01 +02:00
parent 544fbf792c
commit 7cfdd06d1e
14 changed files with 306 additions and 59 deletions
@@ -36,6 +36,7 @@ kotlin {
implementation(projects.frontend.features.deviceInitialization)
implementation(projects.frontend.features.znsImportFeature)
implementation(projects.frontend.features.turnierFeature)
implementation(projects.frontend.features.veranstalterFeature)
implementation(compose.foundation)
implementation(compose.runtime)
@@ -1,6 +1,5 @@
package at.mocode.veranstaltung.feature.di
import at.mocode.frontend.core.domain.zns.ZnsImportProvider
import at.mocode.veranstaltung.feature.presentation.EventWizardViewModel
import at.mocode.veranstaltung.feature.presentation.VeranstaltungManagementViewModel
import org.koin.core.qualifier.named
@@ -8,5 +7,16 @@ import org.koin.dsl.module
val veranstaltungModule = module {
factory { VeranstaltungManagementViewModel(get()) }
factory { EventWizardViewModel(get(named("apiClient")), get(), get(), get(), get<ZnsImportProvider>(), get()) }
factory { (veranstalterId: Long?) ->
EventWizardViewModel(
veranstalterIdParam = veranstalterId,
httpClient = get(named("apiClient")),
authTokenManager = get(),
vereinRepository = get(),
veranstalterRepository = get(),
masterdataRepository = get(),
znsImportProvider = get(),
turnierWizardViewModel = get()
)
}
}
@@ -13,6 +13,7 @@ import at.mocode.frontend.core.domain.zns.ZnsImportProvider
import at.mocode.frontend.core.domain.zns.ZnsRemoteVerein
import at.mocode.frontend.core.network.NetworkConfig
import at.mocode.frontend.features.turnier.presentation.TurnierWizardViewModel
import at.mocode.frontend.features.veranstalter.domain.VeranstalterRepository
import at.mocode.frontend.features.verein.domain.VereinRepository
import io.ktor.client.*
import io.ktor.client.request.*
@@ -64,9 +65,11 @@ data class VeranstaltungWizardState(
@OptIn(ExperimentalUuidApi::class)
class EventWizardViewModel(
private val veranstalterIdParam: Long?,
private val httpClient: HttpClient,
private val authTokenManager: AuthTokenManager,
private val vereinRepository: VereinRepository,
private val veranstalterRepository: VeranstalterRepository,
private val masterdataRepository: MasterdataRepository,
private val znsImportProvider: ZnsImportProvider,
val turnierWizardViewModel: TurnierWizardViewModel // Injected Child-ViewModel
@@ -80,6 +83,27 @@ class EventWizardViewModel(
checkStammdatenStatus()
// Simulation eines Initial-Datums
state = state.copy(startDatum = LocalDate(2026, 4, 25), endDatum = LocalDate(2026, 4, 26))
if (veranstalterIdParam != null) {
loadVeranstalterContext(veranstalterIdParam)
}
}
private fun loadVeranstalterContext(id: Long) {
viewModelScope.launch {
val result = veranstalterRepository.getById(id)
result.onSuccess { v ->
setVeranstalter(
id = Uuid.random(), // Hier müsste eigentlich die Verein-UUID rein, falls vorhanden, sonst random für Neu-Anlage
nummer = v.oepsNummer,
name = v.name,
standardOrt = v.ort,
logo = v.logoBase64 ?: v.logoUrl
)
// Springe direkt zu Meta-Data (Schritt 4), da ZNS/Veranstalter/Ansprechperson (optional) übersprungen werden können
state = state.copy(currentStep = WizardStep.META_DATA)
}
}
}
fun checkZnsAvailability() {