Add room type images list endpoint
All checks were successful
build-and-deploy / build-deploy (push) Successful in 32s

This commit is contained in:
androidlover5842
2026-01-27 23:34:37 +05:30
parent e4c38a699f
commit df351204ed
4 changed files with 99 additions and 0 deletions

View File

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