Include active room numbers in booking list
All checks were successful
build-and-deploy / build-deploy (push) Successful in 35s

This commit is contained in:
androidlover5842
2026-01-29 20:05:55 +05:30
parent 62f2cc5aaa
commit 26b7392806
3 changed files with 26 additions and 0 deletions

View File

@@ -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
}