diff --git a/frontend/core/wizard/src/commonMain/kotlin/at/mocode/frontend/core/wizard/samples/EventFlowSample.kt b/frontend/core/wizard/src/commonMain/kotlin/at/mocode/frontend/core/wizard/samples/EventFlowSample.kt index 5a280890..ef64e13a 100644 --- a/frontend/core/wizard/src/commonMain/kotlin/at/mocode/frontend/core/wizard/samples/EventFlowSample.kt +++ b/frontend/core/wizard/src/commonMain/kotlin/at/mocode/frontend/core/wizard/samples/EventFlowSample.kt @@ -10,12 +10,20 @@ import at.mocode.frontend.core.wizard.runtime.WizardState sealed interface DemoEventStep : StepId { data object ZnsCheck : DemoEventStep data object VeranstalterSelection : DemoEventStep + data object AnsprechpersonMapping : DemoEventStep + data object MetaData : DemoEventStep } -data class DemoEventAcc(val dummy: String = "") +data class DemoEventAcc( + val veranstalterId: String? = null, + val veranstalterNr: String = "" +) object DemoEventGuards { val hasZns: Guard = { ctx, _ -> (ctx.stats?.vereinCount ?: 0) > 0 } + // Platzhalter-Guard: aktuell stets true, damit Verhalten dem Legacy-Pfad entspricht. + // Wird später durch echte Domänenlogik ersetzt (Veranstalter-Typ/ID etc.). + val needsContactPerson: Guard = { _, _ -> true } } val DemoEventFlow = flow(start = DemoEventStep.ZnsCheck) { @@ -23,6 +31,10 @@ val DemoEventFlow = flow(start = DemoEventStep.ZnsC whenGuard("hasZns", DemoEventGuards.hasZns, go = DemoEventStep.VeranstalterSelection) otherwise(DemoEventStep.VeranstalterSelection) } + step(DemoEventStep.VeranstalterSelection) { + whenGuard("needsContactPerson", DemoEventGuards.needsContactPerson, go = DemoEventStep.AnsprechpersonMapping) + otherwise(DemoEventStep.MetaData) + } } // Hilfsfunktion für einfache manuelle Nutzung im Spike diff --git a/frontend/features/veranstaltung-feature/src/jvmMain/kotlin/at/mocode/veranstaltung/feature/presentation/EventWizardViewModel.kt b/frontend/features/veranstaltung-feature/src/jvmMain/kotlin/at/mocode/veranstaltung/feature/presentation/EventWizardViewModel.kt index 85b4c9e3..927e5879 100644 --- a/frontend/features/veranstaltung-feature/src/jvmMain/kotlin/at/mocode/veranstaltung/feature/presentation/EventWizardViewModel.kt +++ b/frontend/features/veranstaltung-feature/src/jvmMain/kotlin/at/mocode/veranstaltung/feature/presentation/EventWizardViewModel.kt @@ -246,13 +246,18 @@ class EventWizardViewModel( } private fun isHandledByRuntime(step: WizardStep): Boolean = when (step) { - WizardStep.ZNS_CHECK, WizardStep.VERANSTALTER_SELECTION -> true + WizardStep.ZNS_CHECK, + WizardStep.VERANSTALTER_SELECTION, + WizardStep.ANSPRECHPERSON_MAPPING, + WizardStep.META_DATA -> true else -> false } private fun mapToWizardStep(step: DemoEventStep): WizardStep? = when (step) { DemoEventStep.ZnsCheck -> WizardStep.ZNS_CHECK DemoEventStep.VeranstalterSelection -> WizardStep.VERANSTALTER_SELECTION + DemoEventStep.AnsprechpersonMapping -> WizardStep.ANSPRECHPERSON_MAPPING + DemoEventStep.MetaData -> WizardStep.META_DATA } fun setVeranstalter(id: Uuid, nummer: String, name: String, standardOrt: String, logo: String?) {