Fix lazy booking load in doc city update
All checks were successful
build-and-deploy / build-deploy (push) Successful in 32s

This commit is contained in:
androidlover5842
2026-01-31 10:57:09 +05:30
parent 1d1cb9c040
commit c21bb53382

View File

@@ -427,7 +427,8 @@ class DocumentExtractionService(
}
private fun applyBookingCityUpdates(document: GuestDocument, results: Map<String, String>) {
val booking = document.booking
val bookingId = document.booking?.id ?: return
val booking = bookingRepo.findById(bookingId).orElse(null) ?: return
if (booking.fromCity?.isNotBlank() == true && booking.toCity?.isNotBlank() == true) return
val pin = cleanedValue(results[DocumentPrompts.PIN_CODE.first]) ?: return
if (!isValidPin(pin)) return