feat: unterstütze Einzeldatei-Import, verbessere Fortschrittsanzeige und Logging im ZNS-Import

Signed-off-by: StefanMoCoAt <stefan.mo.co@gmail.com>
This commit is contained in:
2026-04-16 23:45:18 +02:00
parent 26b3b193ca
commit a1194adeac
8 changed files with 271 additions and 40 deletions
@@ -30,9 +30,9 @@ data class ImportStartResponse(val jobId: String)
internal data class JobStatusResponse(
val jobId: String,
val status: String,
val progress: Int = 0,
val progressDetail: String = "",
val errors: List<String> = emptyList(),
val fortschritt: Int = 0,
val meldungen: List<String> = emptyList(),
val fehler: List<String> = emptyList(),
)
private val TERMINAL_STATES = setOf("ABGESCHLOSSEN", "FEHLER")
@@ -111,9 +111,9 @@ class ZnsImportViewModel(
val status = json.decodeFromString<JobStatusResponse>(response.bodyAsText())
state = state.copy(
jobStatus = status.status,
progress = status.progress,
progressDetail = status.progressDetail,
errors = status.errors.takeLast(MAX_VISIBLE_ERRORS),
progress = status.fortschritt,
progressDetail = status.meldungen.lastOrNull() ?: "",
errors = status.fehler.takeLast(MAX_VISIBLE_ERRORS),
isFinished = status.status in TERMINAL_STATES,
)
if (status.status in TERMINAL_STATES) break