package com.yc.ship.module.trade.controller.admin.orderjzdetail.vo;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import javax.validation.Valid;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.util.List;

@Schema(description = "管理后台 - 订单批量分车 Request VO")
@Data
public class OrderJzDispatchBatchReqVO {


    @Schema(description = "分车信息", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "分车信息不能为空")
    @Valid
    private DispatchInfo dispatchInfo;

    @Schema(description = "接站人员列表（含分车ID，有dispatchId则更新，无则新建）", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotEmpty(message = "接站人员列表不能为空")
    @Valid
    private List<OrderItem> orderItems;

    @Schema(description = "接站人员明细")
    @Data
    public static class OrderItem {

        @Schema(description = "蹭送行程游客记录ID，为空则新增记录", example = "1")
        private Long id;

        @Schema(description = "分车记录ID（OrderJzDispatchDO.id），有值则更新，无值则新建", example = "100")
        private Long dispatchId;

        @Schema(description = "游客ID", example = "1")
        private Long visitorId;

        @Schema(description = "航次ID", example = "1")
        private Long voyageId;

        @Schema(description = "订单ID", example = "1")
        private Long orderId;
    }

    @Schema(description = "分车信息")
    @Data
    public static class DispatchInfo {

        @Schema(description = "航次ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
        @NotNull(message = "航次ID不能为空")
        private Long voyageId;

        @Schema(description = "分车号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1号车")
        @NotBlank(message = "分车号不能为空")
        private String dispatchNo;

        @Schema(description = "分车组团号", requiredMode = Schema.RequiredMode.REQUIRED, example = "T2024010001")
        @NotBlank(message = "分车组团号不能为空")
        private String groupNo;

        @Schema(description = "车牌号", example = "川A12345")
        private String busNumber;

        @Schema(description = "司机姓名", example = "张三")
        private String driverName;

        @Schema(description = "司机联系电话", example = "13800138000")
        private String driverPhone;

        @Schema(description = "接站人员", example = "李四")
        private String receiverName;

        @Schema(description = "接站人电话", example = "13900139000")
        private String receiverPhone;

        @Schema(description = "分车来源类型（1：接站服务 2：赠送行程）", example = "1")
        private Integer sourceType;

        @Schema(description = "备注", example = "备注信息")
        private String remark;

        @Schema(description = "接站人数", example = "1")
        private Integer passengerCount;
    }
}
