Link existing guest to booking by phone
All checks were successful
build-and-deploy / build-deploy (push) Successful in 35s

This commit is contained in:
androidlover5842
2026-01-29 04:07:41 +05:30
parent ffe26a4739
commit b6ac87d277

View File

@@ -55,7 +55,10 @@ class Guests(
} }
val existing = guestRepo.findByPropertyIdAndPhoneE164(propertyId, phone) val existing = guestRepo.findByPropertyIdAndPhoneE164(propertyId, phone)
if (existing != null) { if (existing != null) {
throw ResponseStatusException(HttpStatus.CONFLICT, "Guest already exists") booking.primaryGuest = existing
booking.updatedAt = OffsetDateTime.now()
bookingRepo.save(booking)
return setOf(existing).toResponse(guestVehicleRepo, guestRatingRepo).first()
} }
val now = OffsetDateTime.now() val now = OffsetDateTime.now()