package space.nstart.pcp.pcp_satellites_service.repository

import org.springframework.data.jpa.repository.JpaRepository
import org.springframework.data.jpa.repository.Modifying
import org.springframework.data.jpa.repository.Query
import org.springframework.data.repository.query.Param
import space.nstart.pcp.pcp_satellites_service.entity.SatelliteModeBookedSlotEntity

interface SatelliteModeBookedSlotRepository : JpaRepository<SatelliteModeBookedSlotEntity, Long> {
    fun findAllByMode_IdIn(modeIds: Collection<Long>): List<SatelliteModeBookedSlotEntity>

    @Modifying
    @Query("delete from SatelliteModeBookedSlotEntity entity where entity.mode.id in :modeIds")
    fun deleteAllByModeIds(@Param("modeIds") modeIds: Collection<Long>): Int
}
