Store DOB in guest age and return in booking detail
All checks were successful
build-and-deploy / build-deploy (push) Successful in 33s
All checks were successful
build-and-deploy / build-deploy (push) Successful in 33s
This commit is contained in:
@@ -550,6 +550,7 @@ class DocumentExtractionService(
|
||||
) {
|
||||
val extractedName = cleanedValue(results[DocumentPrompts.NAME.first])
|
||||
val extractedAddress = cleanedValue(results[DocumentPrompts.ADDRESS.first])
|
||||
val extractedDob = cleanedValue(results[DocumentPrompts.DOB.first])
|
||||
val resolvedCountry = if (results["geoResolved"] != null) "India" else null
|
||||
val guestIdValue = document.guest.id
|
||||
if (guestIdValue != null && (extractedName != null || extractedAddress != null)) {
|
||||
@@ -564,6 +565,13 @@ class DocumentExtractionService(
|
||||
guestEntity.addressText = extractedAddress
|
||||
updated = true
|
||||
}
|
||||
if (guestEntity.age.isNullOrBlank() && extractedDob != null) {
|
||||
val dob = parseDob(extractedDob)
|
||||
if (dob != null) {
|
||||
guestEntity.age = dob.format(DateTimeFormatter.ofPattern("dd/MM/yyyy"))
|
||||
updated = true
|
||||
}
|
||||
}
|
||||
if (guestEntity.nationality.isNullOrBlank() && resolvedCountry != null) {
|
||||
guestEntity.nationality = resolvedCountry
|
||||
updated = true
|
||||
|
||||
Reference in New Issue
Block a user