package space.nstart.pcp.slots_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.slots_service.entity.SatelliteIcEntity

interface SatelliteIcRepository : JpaRepository<SatelliteIcEntity, Long> {
    fun findAllByOrderBySatelliteIdAsc(): List<SatelliteIcEntity>

    @Modifying
    @Query("delete from SatelliteIcEntity entity where entity.satelliteId = :satelliteId")
    fun deleteBySatelliteId(@Param("satelliteId") satelliteId: Long): Int
}
