package com.qmth.exam.reserve.bean.apply;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.qmth.exam.reserve.bean.IModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;

@Getter
@Setter
public class ApplyVO implements IModel, Comparable<ApplyVO> {

    private static final long serialVersionUID = 2804383719693396546L;

    @ApiModelProperty(value = "预约记录ID")
    private Long applyId;

    @ApiModelProperty(value = "预约时段ID")
    private Long timePeriodId;

    @ApiModelProperty(value = "预约的开始时间")
    private Long timePeriodStart;

    @ApiModelProperty(value = "预约的结束时间")
    private Long timePeriodEnd;

    @ApiModelProperty(value = "教学点ID")
    private Long categoryId;

    @ApiModelProperty(value = "教学点名称")
    private String categoryName;

    @ApiModelProperty(value = "考点ID")
    private Long examSiteId;

    @ApiModelProperty(value = "考点名称")
    private String examSiteName;

    @ApiModelProperty(value = "考点地址")
    private String examSiteAddress;

    @ApiModelProperty(value = "是否已取消预约")
    private Boolean cancel;

    @ApiModelProperty(value = "是否允许取消预约")
    private Boolean allowCancel;

    @ApiModelProperty(value = "是否显示电子准考证标志")
    private Boolean showTicket;

    @JsonIgnore
    @ApiModelProperty(value = "准考证号", hidden = true)
    private String ticketNumber;

    @Override
    public int compareTo(ApplyVO obj) {
        if (this.getTimePeriodStart() > obj.getTimePeriodStart()) {
            return -1;
        } else if (this.getTimePeriodStart() < obj.getTimePeriodStart()) {
            return 1;
        } else {
            return 0;
        }
    }

}
