package space.nstart.pcp.slots_service.czml

import com.fasterxml.jackson.annotation.JsonIgnoreProperties
import com.fasterxml.jackson.annotation.JsonInclude
import io.swagger.v3.oas.annotations.media.Schema
import lombok.AllArgsConstructor
import lombok.Data
import lombok.NoArgsConstructor
import space.nstart.pcp.pcp_types_lib.utils.UtcDateTimes
import java.time.LocalDateTime


@Data
@NoArgsConstructor
@AllArgsConstructor
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonIgnoreProperties(ignoreUnknown = true)
@Schema(description = "Часы")
class CZMLClock(
    val interval : String = "",
    val currentTime : String = "",
    val multiplayer : Int = 1,
    var range : String = "LOOP_STOP",
    var step : String = "SYSTEM_CLOCK_MULTIPLIER"
) {
    constructor(tn : LocalDateTime, tk : LocalDateTime, cur : LocalDateTime) : this(
        interval = "${UtcDateTimes.format(tn)}/${UtcDateTimes.format(tk)}",
        currentTime = UtcDateTimes.format(cur)
    )

}