Include active room numbers in booking list
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:
@@ -89,4 +89,20 @@ interface RoomStayRepo : JpaRepository<RoomStay, UUID> {
|
||||
where rs.room.id = :roomId
|
||||
""")
|
||||
fun existsByRoomId(@Param("roomId") roomId: UUID): Boolean
|
||||
|
||||
@Query("""
|
||||
select rs.booking.id as bookingId, r.roomNumber as roomNumber
|
||||
from RoomStay rs
|
||||
join rs.room r
|
||||
where rs.booking.id in :bookingIds
|
||||
and rs.toAt is null
|
||||
""")
|
||||
fun findActiveRoomNumbersByBookingIds(
|
||||
@Param("bookingIds") bookingIds: List<UUID>
|
||||
): List<BookingRoomNumberRow>
|
||||
}
|
||||
|
||||
interface BookingRoomNumberRow {
|
||||
val bookingId: UUID
|
||||
val roomNumber: Int
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user