package cn.palmte.work.bean;

/**
 * @author xiongshiyan at 2021/11/1 , contact me with email yanshixiong@126.com or phone 15208384257
 */
public enum ApproveStatusEnum {
    APPROVAL_UNCOMMIT(0,"草稿"),
    APPROVAL_PENDING(1,"待审核"),
    APPROVAL_PASSED(2,"审核通过"),
    APPROVAL_UNPASS(3,"审核不通过");

    private int approveStatus;
    private String approveStatusDesc;

    ApproveStatusEnum(int approveStatus, String approveStatusDesc) {
        this.approveStatus = approveStatus;
        this.approveStatusDesc = approveStatusDesc;
    }

    public int getApproveStatus() {
        return approveStatus;
    }

    public void setApproveStatus(int approveStatus) {
        this.approveStatus = approveStatus;
    }

    public String getApproveStatusDesc() {
        return approveStatusDesc;
    }

    public void setApproveStatusDesc(String approveStatusDesc) {
        this.approveStatusDesc = approveStatusDesc;
    }

    public static ApproveStatusEnum parseApproveStatus(int approveStatus){
        if(approveStatus == 0){
            return APPROVAL_UNCOMMIT;
        }
        if(approveStatus == 1){
            return APPROVAL_PENDING;
        }
        if(approveStatus == 2){
            return APPROVAL_PASSED;
        }
        if(approveStatus == 3){
            return APPROVAL_UNPASS;
        }
        throw new IllegalArgumentException("Unkown approveStatus:"+approveStatus);
    }
}
