package space.nstart.pcp.pcp_satellites_service.model.mode

import space.nstart.pcp.pcp_satellites_service.entity.SatelliteModeSource
import space.nstart.pcp.pcp_types_lib.dto.satellite.modes.SurveyModeInfoDTO
import space.nstart.pcp.pcp_types_lib.utils.UtcDateTimes
import java.time.LocalDateTime

class SurveyMode(
    val revolution : Long = 1,
    val time : LocalDateTime = UtcDateTimes.now(),
    val timeStop : LocalDateTime = UtcDateTimes.now(),
    val roll : Double = 0.0,
    val latitude : Double = 0.0,
    val longitude : Double = 0.0,
    val duration : Double = 0.0,
    val contourWKT : String = "",
    val cellNum : Long = 0,
    val source: SatelliteModeSource = SatelliteModeSource.COMPLAN,
    val bookedSlotIds: List<Long> = emptyList(),
    val cellNums: List<Long> = emptyList()
) {
    fun toDTO() = SurveyModeInfoDTO(
        revolution = revolution,
        time = time,
        timStop = timeStop,
        roll = roll,
        duration = duration,
        contourWKT = contourWKT,
        slotIds = bookedSlotIds,
        latitude = latitude,
        longitude = longitude
    )
}
