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/30 14:43
 */
@Getter
@AllArgsConstructor
public enum AuditModeEnum {

    /**
     * 0会审，1或审
     */
    OR_AUDIT(1, "或审"),
    AND_AUDIT(0, "会审");

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

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


    public static String getName(Integer type) {
        for (AuditModeEnum typeEnum : AuditModeEnum.values()) {
            if (ObjectUtil.equals(typeEnum.mode, type)) {
                return typeEnum.value;
            }
        }
        return null;
    }
}
