Add active room stays endpoint
All checks were successful
build-and-deploy / build-deploy (push) Successful in 27s
All checks were successful
build-and-deploy / build-deploy (push) Successful in 27s
This commit is contained in:
@@ -62,4 +62,17 @@ interface RoomStayRepo : JpaRepository<RoomStay, UUID> {
|
||||
@Param("fromAt") fromAt: java.time.OffsetDateTime,
|
||||
@Param("toAt") toAt: java.time.OffsetDateTime
|
||||
): Boolean
|
||||
|
||||
@Query("""
|
||||
select rs
|
||||
from RoomStay rs
|
||||
join fetch rs.room r
|
||||
join fetch r.roomType rt
|
||||
join fetch rs.booking b
|
||||
left join fetch b.primaryGuest g
|
||||
where rs.property.id = :propertyId
|
||||
and rs.toAt is null
|
||||
order by r.roomNumber
|
||||
""")
|
||||
fun findActiveByPropertyIdWithDetails(@Param("propertyId") propertyId: UUID): List<RoomStay>
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user