Add amenities and size fields to room types
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:
@@ -0,0 +1,13 @@
|
||||
package com.android.trisolarisserver.repo
|
||||
|
||||
import com.android.trisolarisserver.models.room.RoomAmenity
|
||||
import org.springframework.data.jpa.repository.JpaRepository
|
||||
import java.util.UUID
|
||||
|
||||
interface RoomAmenityRepo : JpaRepository<RoomAmenity, UUID> {
|
||||
fun findByIdAndPropertyId(id: UUID, propertyId: UUID): RoomAmenity?
|
||||
fun findByPropertyIdOrderByName(propertyId: UUID): List<RoomAmenity>
|
||||
fun findByPropertyIdAndIdIn(propertyId: UUID, ids: Set<UUID>): List<RoomAmenity>
|
||||
fun existsByPropertyIdAndName(propertyId: UUID, name: String): Boolean
|
||||
fun existsByPropertyIdAndNameAndIdNot(propertyId: UUID, name: String, id: UUID): Boolean
|
||||
}
|
||||
@@ -10,10 +10,10 @@ import java.util.UUID
|
||||
|
||||
interface RoomRepo : JpaRepository<Room, UUID> {
|
||||
|
||||
@EntityGraph(attributePaths = ["roomType", "roomType.otaAliases"])
|
||||
@EntityGraph(attributePaths = ["roomType", "roomType.otaAliases", "roomType.amenities"])
|
||||
fun findByPropertyIdOrderByRoomNumber(propertyId: UUID): List<Room>
|
||||
|
||||
@EntityGraph(attributePaths = ["roomType", "roomType.otaAliases"])
|
||||
@EntityGraph(attributePaths = ["roomType", "roomType.otaAliases", "roomType.amenities"])
|
||||
fun findByIdAndPropertyId(id: UUID, propertyId: UUID): Room?
|
||||
|
||||
fun existsByPropertyIdAndRoomNumber(propertyId: UUID, roomNumber: Int): Boolean
|
||||
|
||||
@@ -8,7 +8,7 @@ import java.util.UUID
|
||||
interface RoomTypeRepo : JpaRepository<RoomType, UUID> {
|
||||
fun findByIdAndPropertyId(id: UUID, propertyId: UUID): RoomType?
|
||||
fun findByPropertyIdAndCodeIgnoreCase(propertyId: UUID, code: String): RoomType?
|
||||
@EntityGraph(attributePaths = ["property", "otaAliases"])
|
||||
@EntityGraph(attributePaths = ["property", "otaAliases", "amenities"])
|
||||
fun findByPropertyIdOrderByCode(propertyId: UUID): List<RoomType>
|
||||
fun existsByPropertyIdAndCode(propertyId: UUID, code: String): Boolean
|
||||
fun existsByPropertyIdAndCodeAndIdNot(propertyId: UUID, code: String, id: UUID): Boolean
|
||||
|
||||
Reference in New Issue
Block a user