package com.multictrl.modules.business.dto;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.multictrl.common.validator.group.AddGroup;
import com.multictrl.common.validator.group.UpdateGroup;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.Data;

import java.io.Serial;
import java.io.Serializable;
import java.util.List;

/**
 * 航线航点信息
 *
 * @author Sdy
 * @since 1.0.0 2026-04-20
 */
@Data
@Schema(name = "航线航点信息")
public class RouteWaypointDTO implements Serializable {
    @Serial
    private static final long serialVersionUID = 1L;

    @Schema(hidden = true)
    private Long id;

    @JsonProperty(required = true)
    @NotNull(message = "{route.waypoint.longitude.require}", groups = {AddGroup.class, UpdateGroup.class})
    @Schema(description = "航点经度")
    private Double longitude;

    @JsonProperty(required = true)
    @NotNull(message = "{route.waypoint.latitude.require}", groups = {AddGroup.class, UpdateGroup.class})
    @Schema(description = "航点纬度")
    private Double latitude;

    @JsonProperty(required = true)
    @NotNull(message = "{route.waypoint.flight.speed.require}", groups = {AddGroup.class, UpdateGroup.class})
    @Schema(description = "航点飞行速度")
    private Double flightSpeed;

    @JsonProperty(required = true)
    @NotNull(message = "{route.waypoint.flight.height.require}", groups = {AddGroup.class, UpdateGroup.class})
    @Schema(description = "航点飞行高度")
    private Double flightHeight;

    @JsonProperty(required = true)
    @NotNull(message = "{route.waypoint.follow.route.speed.require}", groups = {AddGroup.class, UpdateGroup.class})
    @Schema(description = "跟随航线速度")
    private Boolean followRouteSpeed;

    @JsonProperty(required = true)
    @NotNull(message = "{route.waypoint.follow.route.height.require}", groups = {AddGroup.class, UpdateGroup.class})
    @Schema(description = "跟随航线高度")
    private Boolean followRouteHeight;

    @JsonProperty(required = true)
    @NotBlank(message = "{route.waypoint.heading.mode.require}", groups = {AddGroup.class, UpdateGroup.class})
    @Schema(description = "飞行器偏航角模式")
    private String waypointHeadingMode;

    @Schema(description = "飞行器偏航角度")
    private String waypointHeadingAngle;

    @JsonProperty(required = true)
    @NotBlank(message = "{route.waypoint.heading.path.mode.require}", groups = {AddGroup.class, UpdateGroup.class})
    @Schema(description = "飞行器偏航角转向")
    private String waypointHeadingPathMode;

    @Schema(description = "兴趣点")
    private String waypointPoiPoint;

    @JsonProperty(required = true)
    @NotBlank(message = "{route.waypoint.turning.mode.require}", groups = {AddGroup.class, UpdateGroup.class})
    @Schema(description = "航点转弯模式")
    private String waypointTruningMode;

    @Schema(description = "航点转弯截距")
    private String waypointTurnDampingDist;

    @Schema(description = "航点动作")
    private List<WaypointActionDTO> waypointActionList;

    @JsonProperty(access = JsonProperty.Access.READ_ONLY)
    @Schema(description = "航点顺序")
    private Integer waypointSort;
}
