package com.yc.ship.module.trade.api.dto;

import com.yc.ship.framework.common.validation.IntEnum;
import com.yc.ship.framework.common.validation.Mobile;
import com.yc.ship.module.trade.enums.CredentialTypeEnum;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.experimental.Accessors;

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

@Schema(description = "游客信息修改请求vo")
@Data
@Accessors(chain = true)
public class TradeModifyVisitorReqDTO {

    @Schema(description = "订单ID", example = "")
    @NotNull(message = "订单ID不能为空")
    private Long orderId;

    @Schema(description = "游客列表", example = "")
    @NotEmpty(message = "游客列表不能为空")
    @Valid
    private List<VisitorItem> visitorList;

    @Schema(description = "游客信息")
    @Data
    @Valid
    public static class VisitorItem{

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

        @Schema(description = "明细ID", example = "")
        @NotNull(message = "detailId不能为空")
        private Long detailId;

        @Schema(description = "姓名", example = "")
        private String name;

        @Schema(description = "证件号", example = "")
        private String credentialNo;

        @Schema(description = "证件类型", example = "")
        @IntEnum(value = CredentialTypeEnum.class,message = "证件类型不正确")
        private Integer credentialType;

        @Mobile
        @Schema(description = "手机号", example = "")
        private String mobile;

        @Schema(description = "规格类型", example = "")
        private String specType;
    }
}

