package space.nstart.pcp.pcp_types_lib.dto.satellite.mission

import com.fasterxml.jackson.annotation.JsonProperty
import java.time.LocalDateTime

data class SatelliteModeResponseDTO(
    val id: Long = 0,
    val satelliteId: Long = 0,
    val source: String = "",
    val type: String = "SURVEY",
    val startTime: LocalDateTime,
    val endTime: LocalDateTime,
    val revolution: Long = 0,
    val lat: Double = 0.0,
    val longitude: Double = 0.0,
    val duration: Double = 0.0,
    val contourWkt: String? = null,
    val roll: Double = 0.0,
    val cellNum: Long = 0,
    val cellNums: List<Long> = emptyList(),
    val bookedSlotIds: List<Long> = emptyList(),
    val snapshotId: Long? = null
) {
    /** Объём режима, Мбайт: сброс — канал 1200 Мбит/с (÷8), иначе — накопление съёмки 120 Мбайт/с. */
    @get:JsonProperty(access = JsonProperty.Access.READ_ONLY)
    val volumeMb: Double
        get() = if (type == "DROP") ModeDataRates.dropVolumeMb(duration) else ModeDataRates.surveyVolumeMb(duration)
}
