Add room type images list endpoint
All checks were successful
build-and-deploy / build-deploy (push) Successful in 32s
All checks were successful
build-and-deploy / build-deploy (push) Successful in 32s
This commit is contained in:
@@ -37,6 +37,20 @@ interface RoomImageRepo : JpaRepository<RoomImage, UUID> {
|
||||
"""
|
||||
)
|
||||
fun findByRoomTypeCodeForReorder(@Param("roomTypeCode") roomTypeCode: String): List<RoomImage>
|
||||
|
||||
@org.springframework.data.jpa.repository.EntityGraph(attributePaths = ["tags"])
|
||||
@Query(
|
||||
"""
|
||||
select ri
|
||||
from RoomImage ri
|
||||
where ri.property.id = :propertyId and ri.roomTypeCode = :roomTypeCode
|
||||
order by case when ri.roomTypeSortOrder is null then 1 else 0 end, ri.roomTypeSortOrder asc, ri.createdAt desc
|
||||
"""
|
||||
)
|
||||
fun findByPropertyIdAndRoomTypeCodeOrdered(
|
||||
@Param("propertyId") propertyId: UUID,
|
||||
@Param("roomTypeCode") roomTypeCode: String
|
||||
): List<RoomImage>
|
||||
fun findByIdAndRoomIdAndPropertyId(id: UUID, roomId: UUID, propertyId: UUID): RoomImage?
|
||||
fun findByIdIn(ids: Collection<UUID>): List<RoomImage>
|
||||
fun existsByRoomIdAndContentHash(roomId: UUID, contentHash: String): Boolean
|
||||
|
||||
Reference in New Issue
Block a user