package space.nstart.pcp.complan.types

import com.fasterxml.jackson.annotation.JsonIgnoreProperties
import com.fasterxml.jackson.annotation.JsonProperty
import io.swagger.v3.oas.annotations.media.Schema
import java.time.LocalDateTime
import java.util.UUID

enum class ComplexPlanCalculationStatus {
    COMPLETED,
    REQUEST_NOT_FOUND,
    NO_AVAILABLE_SATELLITES
}

@Schema(description = "Результат запуска расчета модели комплексного плана")
@JsonIgnoreProperties(ignoreUnknown = true)
data class ComplexPlanCalculationResultDTO(
    @get:JsonProperty("status")
    @param:JsonProperty("status")
    val status: ComplexPlanCalculationStatus,

    @get:JsonProperty("requestId")
    @param:JsonProperty("requestId")
    val requestId: UUID,

    @get:JsonProperty("satelliteIds")
    @param:JsonProperty("satelliteIds")
    val satelliteIds: List<Long>,

    @get:JsonProperty("missingSatelliteIds")
    @param:JsonProperty("missingSatelliteIds")
    val missingSatelliteIds: List<Long>,

    @get:JsonProperty("calculationStart")
    @param:JsonProperty("calculationStart")
    val calculationStart: LocalDateTime,

    @get:JsonProperty("calculationEnd")
    @param:JsonProperty("calculationEnd")
    val calculationEnd: LocalDateTime,

    @get:JsonProperty("calculationMode")
    @param:JsonProperty("calculationMode")
    val calculationMode: DynamicPlanCalculationMode = DynamicPlanCalculationMode.FULL,

    @get:JsonProperty("revolutionMode")
    @param:JsonProperty("revolutionMode")
    val revolutionMode: DynamicPlanRevolutionMode = DynamicPlanRevolutionMode.BOTH,

    @get:JsonProperty("filterCoveredRoutes")
    @param:JsonProperty("filterCoveredRoutes")
    val filterCoveredRoutes: Boolean = false,

    @get:JsonProperty("routesCount")
    @param:JsonProperty("routesCount")
    val routesCount: Int,

    @get:JsonProperty("lastRouteStart")
    @param:JsonProperty("lastRouteStart")
    val lastRouteStart: LocalDateTime? = null,

    @get:JsonProperty("lastRouteEnd")
    @param:JsonProperty("lastRouteEnd")
    val lastRouteEnd: LocalDateTime? = null,

    @get:JsonProperty("coveredAreaPercent")
    @param:JsonProperty("coveredAreaPercent")
    val coveredAreaPercent: Double? = null,

    @get:JsonProperty("durationMs")
    @param:JsonProperty("durationMs")
    val durationMs: Long
)
