package space.nstart.pcp.pcp_mission_planing_service.service.satellite_type

import space.nstart.pcp.pcp_mission_planing_service.entity.PlanEntity
import space.nstart.pcp.pcp_mission_planing_service.entity.SurveyModeEntity
import space.nstart.pcp.pcp_types_lib.dto.satellite.SatelliteDTO
import space.nstart.pcp.pcp_types_lib.dto.satellite.mission.SatelliteModeResponseDTO

/**
 * Type-specific mission planning behavior for one satellite type.
 *
 * Implementations encapsulate all rules that may differ by satellite type:
 * survey preparation, survey restrictions, drop duration formulas and future
 * type-specific constraints. The default implementation must preserve current
 * legacy mission planning behavior.
 */
interface SatelliteMissionType {
    val typeCode: String

    fun supports(satelliteTypeCode: String?): Boolean =
        satelliteTypeCode?.trim()?.equals(typeCode, ignoreCase = true) == true

    fun prepareSurvey(
        satellite: SatelliteDTO,
        surv: SatelliteModeResponseDTO,
        plan: PlanEntity
    ): SurveyModeEntity

    fun calculateDropDuration(
        satellite: SatelliteDTO,
        survey: SurveyModeEntity
    ): Double
}
