add booking flow
This commit is contained in:
@@ -27,4 +27,24 @@ interface RoomStayRepo : JpaRepository<RoomStay, UUID> {
|
||||
@Param("fromAt") fromAt: java.time.OffsetDateTime,
|
||||
@Param("toAt") toAt: java.time.OffsetDateTime
|
||||
): List<UUID>
|
||||
|
||||
@Query("""
|
||||
select rs
|
||||
from RoomStay rs
|
||||
where rs.booking.id = :bookingId
|
||||
and rs.toAt is null
|
||||
""")
|
||||
fun findActiveByBookingId(@Param("bookingId") bookingId: UUID): List<RoomStay>
|
||||
|
||||
@Query("""
|
||||
select rs.room.id
|
||||
from RoomStay rs
|
||||
where rs.property.id = :propertyId
|
||||
and rs.room.id in :roomIds
|
||||
and rs.toAt is null
|
||||
""")
|
||||
fun findActiveRoomIds(
|
||||
@Param("propertyId") propertyId: UUID,
|
||||
@Param("roomIds") roomIds: List<UUID>
|
||||
): List<UUID>
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user