package gc.mda.signal_batch.domain.vessel.dto;

import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Builder;
import lombok.Data;

import java.math.BigDecimal;
import java.time.LocalDateTime;

@Data
@Builder
@Schema(description = "항적 세그먼트 (V1 API용, WKT 기반)")
public class TrackResponse {

    @JsonProperty("mmsi")
    @Schema(description = "MMSI (선박 식별자)", example = "440113620")
    private String mmsi;

    @JsonProperty("track_geom")
    @Schema(
        description = "항적 geometry (WKT LineStringM 형식: X=경도, Y=위도, M=Unix timestamp)",
        example = "LINESTRING M(127.0638 34.227527 1768878312, 127.063303 34.226685 1768878332, 127.063008 34.226203 1768878342)"
    )
    private String trackGeom;

    @JsonProperty("distance_nm")
    @Schema(description = "이동거리 (해리)", example = "1.64")
    private BigDecimal distanceNm;

    @JsonProperty("avg_speed")
    @Schema(description = "평균 속도 (knots)", example = "10.54")
    private BigDecimal avgSpeed;

    @JsonProperty("max_speed")
    @Schema(description = "최대 속도 (knots)", example = "10.9")
    private BigDecimal maxSpeed;

    @JsonProperty("point_count")
    @Schema(description = "포인트 수", example = "38")
    private Integer pointCount;

    @JsonProperty("time_bucket")
    @Schema(description = "시간 버킷 (5분/1시간/1일 집계 단위)", example = "2026-01-20T12:00:00")
    private LocalDateTime timeBucket;
}
