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
|
||||
|
||||
@@ -59,6 +59,7 @@ class BookingSnapshotBuilder(
|
||||
guestPhone = guest?.phoneE164,
|
||||
guestNationality = guest?.nationality,
|
||||
guestAddressText = guest?.addressText,
|
||||
guestAge = guest?.age,
|
||||
guestSignatureUrl = signatureUrl,
|
||||
vehicleNumbers = vehicleNumbers,
|
||||
roomNumbers = roomNumbers,
|
||||
|
||||
@@ -84,6 +84,7 @@ data class BookingDetailResponse(
|
||||
val guestPhone: String?,
|
||||
val guestNationality: String?,
|
||||
val guestAddressText: String?,
|
||||
val guestAge: String?,
|
||||
val guestSignatureUrl: String?,
|
||||
val vehicleNumbers: List<String>,
|
||||
val roomNumbers: List<Int>,
|
||||
|
||||
@@ -29,6 +29,9 @@ class Guest(
|
||||
@Column(name = "address_text")
|
||||
var addressText: String? = null,
|
||||
|
||||
@Column(name = "age")
|
||||
var age: String? = null,
|
||||
|
||||
@Column(name = "signature_path")
|
||||
var signaturePath: String? = null,
|
||||
|
||||
|
||||
Reference in New Issue
Block a user