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 extractedName = cleanedValue(results[DocumentPrompts.NAME.first])
|
||||||
val extractedAddress = cleanedValue(results[DocumentPrompts.ADDRESS.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 resolvedCountry = if (results["geoResolved"] != null) "India" else null
|
||||||
val guestIdValue = document.guest.id
|
val guestIdValue = document.guest.id
|
||||||
if (guestIdValue != null && (extractedName != null || extractedAddress != null)) {
|
if (guestIdValue != null && (extractedName != null || extractedAddress != null)) {
|
||||||
@@ -564,6 +565,13 @@ class DocumentExtractionService(
|
|||||||
guestEntity.addressText = extractedAddress
|
guestEntity.addressText = extractedAddress
|
||||||
updated = true
|
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) {
|
if (guestEntity.nationality.isNullOrBlank() && resolvedCountry != null) {
|
||||||
guestEntity.nationality = resolvedCountry
|
guestEntity.nationality = resolvedCountry
|
||||||
updated = true
|
updated = true
|
||||||
|
|||||||
@@ -59,6 +59,7 @@ class BookingSnapshotBuilder(
|
|||||||
guestPhone = guest?.phoneE164,
|
guestPhone = guest?.phoneE164,
|
||||||
guestNationality = guest?.nationality,
|
guestNationality = guest?.nationality,
|
||||||
guestAddressText = guest?.addressText,
|
guestAddressText = guest?.addressText,
|
||||||
|
guestAge = guest?.age,
|
||||||
guestSignatureUrl = signatureUrl,
|
guestSignatureUrl = signatureUrl,
|
||||||
vehicleNumbers = vehicleNumbers,
|
vehicleNumbers = vehicleNumbers,
|
||||||
roomNumbers = roomNumbers,
|
roomNumbers = roomNumbers,
|
||||||
|
|||||||
@@ -84,6 +84,7 @@ data class BookingDetailResponse(
|
|||||||
val guestPhone: String?,
|
val guestPhone: String?,
|
||||||
val guestNationality: String?,
|
val guestNationality: String?,
|
||||||
val guestAddressText: String?,
|
val guestAddressText: String?,
|
||||||
|
val guestAge: String?,
|
||||||
val guestSignatureUrl: String?,
|
val guestSignatureUrl: String?,
|
||||||
val vehicleNumbers: List<String>,
|
val vehicleNumbers: List<String>,
|
||||||
val roomNumbers: List<Int>,
|
val roomNumbers: List<Int>,
|
||||||
|
|||||||
@@ -29,6 +29,9 @@ class Guest(
|
|||||||
@Column(name = "address_text")
|
@Column(name = "address_text")
|
||||||
var addressText: String? = null,
|
var addressText: String? = null,
|
||||||
|
|
||||||
|
@Column(name = "age")
|
||||||
|
var age: String? = null,
|
||||||
|
|
||||||
@Column(name = "signature_path")
|
@Column(name = "signature_path")
|
||||||
var signaturePath: String? = null,
|
var signaturePath: String? = null,
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user