package com.aircraft.modules.order.domain.dto;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.DecimalMin;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
 *
 * 新增订单DTO
 *
 * @author chenxiky
 * @version 1.0.0
 * @since 2025/7/14
 */
@Data
public class AddOrderDTO {
    /**
     * 订单类型: 目前只有一种类型载物：值为 1
     */
    @ApiModelProperty(value = "订单类型", example = "1:载物类型", required = true)
    private Integer orderType;

    /**
     * 客户ID
     */
    @NotNull(message = "客户ID不能为空")
    @ApiModelProperty(value = "客户ID", required = true)
    private Long customerId;

    /**
     * 客户手机号
     */
    @NotBlank(message = "客户手机号不能为空")
    @ApiModelProperty(value = "客户手机号", required = true)
    private String phone;

    /**
     * 景区ID
     */
    @NotNull(message = "景区ID不能为空")
    @ApiModelProperty(value = "景区ID", required = true)
    private Long attractionId;

    /**
     * 路线ID集合
     */
    @NotNull
    @NotEmpty(message = "路线ID集合不能为空")
    @ApiModelProperty(value = "路线ID集合", required = true)
    private List<Long> routeIds;

    /**
     * 货物重量
     */
    @NotNull
    @DecimalMin(value = "0.01", message = "货物重量必须大于0")
    @ApiModelProperty(value = "货物重量", required = true)
    private BigDecimal cargoWeight;

    /**
     * 额外费用
     */
    @NotNull
    @ApiModelProperty(value = "额外费用", required = true)
    @DecimalMin(value = "0", message = "额外费用不能小于0")
    private BigDecimal surchargeAmount;

    /**
     * 操作人集合ID
     */
    @NotNull
    @NotEmpty(message = "操作人集合ID不能为空")
    @ApiModelProperty(value = "操作人集合ID", required = true)
    private List<Long> operatorIds;

    /**
     * 下单时间
     */
    @NotNull(message = "下单时间不能为空")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "下单时间", example = "2023-08-01 12:00:00", required = true)
    private Date orderCreateTime;

}
