package space.nstart.pcp.pcp_mission_planing_service.repository

import org.springframework.data.jpa.repository.JpaRepository
import space.nstart.pcp.pcp_mission_planing_service.entity.PlanEntity
import java.util.Optional
import java.util.UUID

interface PlanRepository : JpaRepository<PlanEntity, Long> {
    fun findAllByMissionMissionIdOrderByPlanNumberAsc(missionId: UUID): List<PlanEntity>
    fun findFirstByMissionMissionIdOrderByIdAsc(missionId: UUID): Optional<PlanEntity>
    fun findFirstByMissionMissionIdAndPlanNumber(missionId: UUID, planNumber: Long): Optional<PlanEntity>
    fun countByMissionSatelliteId(satelliteId: Long): Long
}
