package com.cool.store.vo;

import com.cool.store.entity.LineAuditInfoDO;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.persistence.*;
import java.util.Date;
import java.util.Objects;

@Data
public class LineAuditInfoVO {

    @ApiModelProperty("审核id")
    private Long auditId;

    @ApiModelProperty("结果类型 0通过,1拒绝,2结束跟进")
    private Integer resultType;

    @ApiModelProperty("通过原因")
    private String passReason;

    @ApiModelProperty("公开拒绝原因")
    private String rejectPublicReason;

    @ApiModelProperty("真实拒绝原因")
    private String rejectRealReason;

    @ApiModelProperty("明文件或凭证")
    private String certifyFile;

    @ApiModelProperty("审批时间")
    private Date createTime;

    public static LineAuditInfoVO convertVO(LineAuditInfoDO auditInfo) {
        if(Objects.isNull(auditInfo)){
            return null;
        }
        LineAuditInfoVO result = new LineAuditInfoVO();
        result.setAuditId(auditInfo.getId());
        result.setResultType(auditInfo.getResultType());
        result.setPassReason(auditInfo.getPassReason());
        result.setRejectPublicReason(auditInfo.getRejectPublicReason());
        result.setRejectRealReason(auditInfo.getRejectRealReason());
        result.setCertifyFile(auditInfo.getCertifyFile());
        result.setCreateTime(auditInfo.getCreateTime());
        return result;
    }
}