Link existing guest to booking by phone
All checks were successful
build-and-deploy / build-deploy (push) Successful in 35s
All checks were successful
build-and-deploy / build-deploy (push) Successful in 35s
This commit is contained in:
@@ -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()
|
||||||
|
|||||||
Reference in New Issue
Block a user