package org.jeecg.modules.app.vo;

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 java.math.BigDecimal;
import java.util.Date;
import java.util.List;

@Data
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@Schema(description="场地详情返回参数")
public class PlaceInfoVO {
    @Schema(description = "场地id")
    private String id;
    @Schema(description = "单位名称（部门名称）")
    private String name;
    @JsonFormat(timezone = "GMT+8",pattern = "HH:mm:ss")
    @DateTimeFormat(pattern="HH:mm:ss")
    @Schema(description = "开始营业时间")
    private Date startTime;
    /**结束营业时间*/
    @JsonFormat(timezone = "GMT+8",pattern = "HH:mm:ss")
    @DateTimeFormat(pattern="HH:mm:ss")
    @Schema(description = "结束营业时间")
    private Date endTime;
    @Schema(description = "好评率")
    private BigDecimal goodRate;
    @Schema(description = "是否营业")
    private Boolean runStatus;
    @Schema(description = "封面")
    private String cover;
    @Schema(description = "地址")
    private String address;
    @Schema(description = "类型;0学校 1包场体育馆 2不固定场体育馆")
    private Integer type;
    @Schema(description = "设施/信息")
    private String facility;
    @Schema(description = "设施/信息")
    private List<String> facilityInfo;
    @Schema(description = "教学日开放时段")
    private String teachingDay;
    @Schema(description = "非教学日开放时段")
    private String noTeachingDay;
    @Schema(description = "联系电话")
    private String phone;
    @Schema(description = "视频")
    private String video;
    @Schema(description = "场地简约返回参数")
    private Object placeInfoMsgVO;
    @Schema(description ="经度")
    private BigDecimal longitude;
    @Schema(description ="纬度")
    private BigDecimal latitude;
    @Schema(description ="vr")
    private String  vr;
    @Schema(description = "教练简约返回参数")
    private List<InstructorVO> instructorVOList;
    @Data
    @Accessors(chain = true)
    @EqualsAndHashCode(callSuper = false)
    @Schema(description="场地简约返回参数-学校")
    public static class PlaceInfoMsgVO{
        @Schema(description = "场地ID")
        private String id;
        @Schema(description = "场地名称")
        private String name;
        @Schema(description = "提示/须知")
        private String reminder;
        @Schema(description = "图片")
        private String cover;
        @Schema(description = "销售数量")
        private int sales;
        @Schema(description = "退款类型;0可退/到期自动退 1限时退 2不可退")
        private Integer refundType;
        @Schema(description = "类目")
        private List<String> category;
        @Schema(description = "原价")
        private BigDecimal originalPrice;
        @Schema(description = "售价")
        private BigDecimal sellingPrice;
    }
    @Data
    @Accessors(chain = true)
    @EqualsAndHashCode(callSuper = false)
    @Schema(description="场地简约返回参数-体育馆（无固定）")
    public static class PlaceInfoGymMsgVO{
        @Schema(description = "id")
        private String id;
        @Schema(description = "场地名称")
        private String name;
        @Schema(description = "提示/须知")
        private String reminder;
        @Schema(description = "退款类型;0可退/到期自动退 1限时退 2不可退")
        private int refundType;
        @Schema(description = "图片")
        private String cover;
        @Schema(description = "销售数量")
        private int sales;
        @Schema(description = "原价")
        private BigDecimal originalPrice;
        @Schema(description = "售价")
        private BigDecimal sellingPrice;
        @Schema(description = "提前预约时间：0免预约 单位：时")
        private int advanceTime;
    }
    @Data
    @Accessors(chain = true)
    @EqualsAndHashCode(callSuper = false)
    @Schema(description="课程返回参数")
    public static class CourseInfoVO{
        @Schema(description = "课程id")
        private String id;
        @Schema(description = "课程名称")
        private String name;
        @Schema(description = "费用类型;0 精品 1免费 仅课程")
        private Integer priceType;
        @Schema(description = "课程原价")
        private BigDecimal originalPrice;
        @Schema(description = "课程售价")
        private BigDecimal sellingPrice;
        @Schema(description = "销售数量")
        private int sales;
        private boolean hasDiscount;
        @Schema(description = "销售(年)")
        private int salesYear;
        @Schema(description = "好评率")
        private BigDecimal goodRate;
        @Schema(description = "地址")
        private String address;
        @Schema(description = "封面")
        private String cover;
        @Schema(description = "课时")
        private int period;
        @Schema(description = "距离")
        private BigDecimal km;
        @JsonFormat(timezone = "GMT+8",pattern = "MM-dd")
        @Schema(description = "开始时间")
        private Date startTime;

        @JsonFormat(timezone = "GMT+8",pattern = "MM-dd")
        @Schema(description = "开始时间")
        private Date endTime;
    }
    @Data
    @Accessors(chain = true)
    @EqualsAndHashCode(callSuper = false)
    @Schema(description="教练简约返回参数")
    public static class InstructorVO{
        @Schema(description = "主键id")
        private String id;
        @Schema(description = "教练名称")
        private String name;
        @Schema(description = "教练头像")
        private String avatar;
        @Schema(description = "擅长说明")
        private String excelMsg;
        @Schema(description = "类目")
        private List<String> category;
    }

    @Data
    @Accessors(chain = true)
    @EqualsAndHashCode(callSuper = false)
    @Schema(description="根据类目类型查询体育馆场地空闲时间段(包场 -门店详情页使用)")
    public static class theGymnasiumIsCharteredVO{
        @Schema(description = "体育馆包场提前退款时间；单位：分钟")
        private int earlyRefundTime;
        @Schema(description = "类目")
        private List<String> category;
        @Schema(description = "VR实景")
        private String vr;
        @Schema(description = "时间段")
        private List<theGymnasiumIsCharteredInfoVO> timeSlot;
    }

    @Data
    @Accessors(chain = true)
    @EqualsAndHashCode(callSuper = false)
    public static class theGymnasiumIsCharteredInfoVO{
        @Schema(description = "场馆id")
        private String id;
        @Schema(description = "日期")
        private String timeRange;
        @Schema(description = "最早可订")
        private String startTime;
        @Schema(description = "排序说明")
        private String dateLabel;
        @Schema(description = "价格")
        private BigDecimal sellingPrice;
    }
}
