feat(online-nennung): integrate online nomination workflow via REST and mail service
- Enabled web-to-backend nominations with `MailController` and REST endpoint (`/api/mail/nennung`). - Added `NennungRemoteRepository` for frontend API integration using Ktor. - Linked `WebMainScreen` to backend API for nomination handling and confirmation display. - Implemented automated confirmation emails for received nominations. - Updated `MASTER_ROADMAP` to reflect progress on Phase 13 milestones. - Improved Nennung UI, backend persistence, and QA tracking for Neumarkt tournament.
This commit is contained in:
+14
-3
@@ -15,13 +15,18 @@ import androidx.compose.ui.text.font.FontWeight
|
||||
import androidx.compose.ui.unit.dp
|
||||
import at.mocode.frontend.core.designsystem.theme.AppColors
|
||||
import at.mocode.frontend.features.billing.presentation.BillingViewModel
|
||||
import at.mocode.frontend.features.nennung.domain.NennungRemoteRepository
|
||||
import at.mocode.frontend.features.nennung.presentation.web.OnlineNennungFormular
|
||||
import kotlinx.coroutines.launch
|
||||
import org.koin.compose.koinInject
|
||||
import org.koin.compose.viewmodel.koinViewModel
|
||||
|
||||
@OptIn(ExperimentalMaterial3Api::class)
|
||||
@Composable
|
||||
fun WebMainScreen() {
|
||||
val billingViewModel: BillingViewModel = koinViewModel()
|
||||
val nennungRepository: NennungRemoteRepository = koinInject()
|
||||
val scope = rememberCoroutineScope()
|
||||
var currentScreen by remember { mutableStateOf<WebScreen>(WebScreen.Landing) }
|
||||
|
||||
Scaffold(
|
||||
@@ -48,9 +53,15 @@ fun WebMainScreen() {
|
||||
is WebScreen.Nennung -> OnlineNennungFormular(
|
||||
turnierNr = screen.turnierId.toString(),
|
||||
onNennenAbgeschickt = { payload ->
|
||||
// Hier wird später der Mail-Versand oder API-Call integriert
|
||||
println("Nennung abgeschickt: $payload")
|
||||
currentScreen = WebScreen.Erfolg(payload.email)
|
||||
scope.launch {
|
||||
val result = nennungRepository.sendeNennung(screen.turnierId.toString(), payload)
|
||||
if (result.isSuccess) {
|
||||
currentScreen = WebScreen.Erfolg(payload.email)
|
||||
} else {
|
||||
// Hier könnte man eine Fehlermeldung anzeigen
|
||||
println("Fehler beim Senden der Nennung: ${result.exceptionOrNull()?.message}")
|
||||
}
|
||||
}
|
||||
},
|
||||
onBack = { currentScreen = WebScreen.Landing }
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user