package com.yida.data.common.core.enums.leave;

import cn.hutool.core.util.ObjectUtil;
import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 审核结果枚举
 *
 * @author ZYJ
 * @date 2023/11/28
 */
@Getter
@AllArgsConstructor
public enum ApprovalResultEnum {

    /**
     * 0-待审核，1-审核通过，2-审核不通过，3-审核中
     */
    AUDIT(0, "待审核"),
    AUDIT_PASS(1, "审核通过"),
    AUDIT_NO(2, "审核不通过"),
    AUDIT_ING(3, "审核中");

    /**
     * 类型
     */
    private final Integer result;

    /**
     * 描述
     */
    private final String dec;


    public static String getDec(Integer type) {
        for (ApprovalResultEnum typeEnum : ApprovalResultEnum.values()) {
            if (ObjectUtil.equals(typeEnum.result, type)) {
                return typeEnum.dec;
            }
        }
        return null;
    }
}
