package space.nstart.pcp.pcp_types_lib.dto.ballistics

import com.fasterxml.jackson.annotation.JsonAlias
import com.fasterxml.jackson.annotation.JsonProperty
import io.swagger.v3.oas.annotations.media.Schema

@Schema(name = "Модель данных для TLE")
class TLEDTO(
    @JsonProperty
    @JsonAlias(value = ["header", "TLE_LINE0"])
    @field:Schema(
        description = "Заголовок",
        required = false,
        nullable = true,
        maxLength = 24,
        example = "ISS (ZARYA)",
        pattern = ".{0,24}"
    )
    var header: String? = null,

    @JsonProperty
    @JsonAlias(value = ["first", "TLE_LINE1"])
    @field:Schema(
        description = "Первая строка данных формата TLE",
        required = true,
        nullable = false,
        minLength = 69,
        maxLength = 69,
        example = "1 25544S 98067A   98324.2847222  -.00003657 11563-4  00000+0  0    10",
        pattern = "(1) (\\d{5})([US ]) (\\d{2})(\\d{3})([A-Z ]{1,3}) (\\d{2})(\\d.{11}) ([-].\\d{8}) ([-+ ]\\d{5}[-+ ]\\d) ([-+ ]\\d{5}[-+ ]\\d) ([0-4]) ([ \\d]{4})(\\d)"
    )
    var first: String = " ".repeat(69),

    @JsonProperty
    @JsonAlias(value = ["second", "TLE_LINE2"])
    @field:Schema(
        description = "Вторая строка данных формата TLE",
        required = true,
        nullable = false,
        minLength = 69,
        maxLength = 69,
        example = "2 25544  51.5908 168.3788 0125362  86.4185 359.7454 16.05064833    05",
        pattern = "(2) (\\d{5}) ([ \\d]{3}.[\\d ]{4}) ([ \\d]{3}.[ \\d]{4}) (\\d{7}) ([ \\d]{3}.[\\d ]{4}) ([ \\d]{3}.[\\d ]{4}) ([ \\d]{2}.[\\d ]{8})([ \\d]{5})(\\d)"
    )
    var second: String = " ".repeat(69)
)