package org.jeecg.modules.app.form;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
import java.util.Map;

@Data
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@Schema(description = "订单表单对象")
public class CreateOrderForm implements Serializable {

    private static final long serialVersionUID = 1L;

    //订单类型；0场地1赛事2课程
    @Schema(description = "订单类型；0场地1赛事2课程", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "订单类型不能为空")
    public Integer type;

    @Schema(description = "订单子类型；0-学校 1-包场 2-无固定场 3-个人赛 4-团队赛 5-课程")
    //订单子类型；0-学校 1-包场 2-无固定场 3-个人赛 4-团队赛
    public Integer orderType;

    //商品IDs
    @NotBlank(message = "商品IDs不能为空")
    @Schema(description = "商品IDs", requiredMode = Schema.RequiredMode.REQUIRED)
    private String productIds;

    //是否试听课程（0-否 1是）
    @Schema(description = "是否试听课程下单（0-否 1是）")
    private Integer orFreeOrder;

    //数量
    @Schema(description = "数量")
    private Integer amount;

    //使用人IDs
    @Schema(description = "使用人IDs")
    private String familyIds;

    //保险表单
    @Schema(description = "保险表单",type = "object")
    private InsureOrderInfoForm insureOrderInfoForm;

    //参赛资质
    @Schema(description = "参赛资质")
    private String gameCertificationForm;

    @Schema(description = "添加年级信息")
    private List<AddGradeLevelInformation> addGradeLevelInformation;

    @Data
    @Accessors(chain = true)
    @EqualsAndHashCode(callSuper = false)
    @Schema(description="添加年级信息")
    public static class AddGradeLevelInformation{
        @Schema(description = "使用人ID")
        private String familyId;
        @Schema(description = "年级信息")
        private String levelInfo;
    }
}
