ai creates booking

This commit is contained in:
androidlover5842
2026-01-24 19:22:37 +05:30
parent b8c9f8dac4
commit ac79d6d1c0
18 changed files with 559 additions and 12 deletions

View File

@@ -239,9 +239,12 @@ data class GuestDocumentResponse(
private fun GuestDocument.toResponse(objectMapper: ObjectMapper): GuestDocumentResponse {
val id = id ?: throw ResponseStatusException(HttpStatus.INTERNAL_SERVER_ERROR, "Document id missing")
val extracted = extractedData?.let {
val extracted: Map<String, String>? = extractedData?.let {
try {
objectMapper.readValue(it, Map::class.java).mapValues { entry -> entry.value?.toString() ?: "" }
val raw = objectMapper.readValue(it, Map::class.java)
raw.entries.associate { entry ->
entry.key.toString() to (entry.value?.toString() ?: "")
}
} catch (_: Exception) {
null
}