package com.android.trisolarisserver.db.repo import com.android.trisolarisserver.models.booking.Booking import org.springframework.data.jpa.repository.JpaRepository import org.springframework.data.jpa.repository.EntityGraph import java.util.UUID interface BookingRepo : JpaRepository { fun findByPropertyIdAndSourceBookingId(propertyId: UUID, sourceBookingId: String): Booking? fun existsByPropertyIdAndSourceBookingId(propertyId: UUID, sourceBookingId: String): Boolean fun countByPrimaryGuestId(guestId: UUID): Long @EntityGraph(attributePaths = ["primaryGuest"]) fun findByPropertyIdAndStatusInOrderByCreatedAtDesc(propertyId: UUID, status: Collection): List @EntityGraph(attributePaths = ["primaryGuest"]) fun findByPropertyIdOrderByCreatedAtDesc(propertyId: UUID): List @EntityGraph(attributePaths = ["property", "primaryGuest", "createdBy"]) fun findDetailedById(id: UUID): java.util.Optional }