Upload via GUI (67 Dateien)

This commit is contained in:
2026-10-23 17:24:21 +00:00
parent 0c5967aa89
commit 1beee34c01
26 changed files with 3009 additions and 1678 deletions
@@ -105,4 +105,31 @@ class ApiDtoParsingTest {
assertEquals("FORBIDDEN", e.error.code)
assertEquals("UNKNOWN", gson.fromJson("""{"error":{}}""", ErrorEnvelope::class.java).error.code)
}
@Test
fun `assistant log with stats filters and feedback parses`() {
val json = """{"filters":{"custom":"Meine Antwort gefunden","none":"Keine Antwort","helpful":"Hat geholfen"},"stats":{"custom":4,"none":1,"helpful":3},
"top":[{"question":"Wie kündige ich?","n":2,"last":"2026-10-22 09:00:00"}],"total":2,"pages":1,"page":1,
"items":[{"id":1,"question":"Wo ist mein Paket?","result":"custom","matchedTitle":"Versand","ticketNumber":null,"helpful":true,"createdAt":"2026-10-22 09:00:00"},
{"id":2,"question":"Wie kündige ich?","result":"none","matchedTitle":null,"ticketNumber":null,"helpful":null,"createdAt":"2026-10-22 09:01:00"}]}"""
val l = gson.fromJson(json, AssistantLogDto::class.java)
assertEquals(listOf("custom", "none", "helpful"), l.filters.keys.toList())
assertEquals(3, l.stats["helpful"])
assertEquals(2, l.top[0].n)
assertEquals(true, l.items[0].helpful)
assertNull(l.items[1].helpful)
}
@Test
fun `assistant overview with settings and options parses`() {
val json = """{"dbReady":true,"settings":{"enabled":true,"mode":"always","name":"Bot","greeting":"Moin","noAnswer":"","departmentId":2,"priorityId":0,"logDays":30,"synonyms":"a, b"},
"defaults":{"name":"Digitaler Assistent","greeting":"Hallo","noAnswer":"Nix"},"state":{"activeNow":true,"liveChatEnabled":false,"kbEnabled":true,"helpdeskOffline":false},
"departments":[{"id":2,"name":"Technik"}],"priorities":[{"id":1,"name":"Normal"}]}"""
val o = gson.fromJson(json, AssistantOverviewDto::class.java)
assertTrue(o.settings.enabled)
assertEquals("always", o.settings.mode)
assertEquals(30, o.settings.logDays)
assertEquals("Technik", o.departments[0].name)
assertTrue(o.state.activeNow)
}
}