package com.bonus.common.biz.enums;

import lombok.Getter;

/**
 * 审批模式枚举
 * 
 * @author syruan
 */
@Getter
public enum ApproveModeEnum {

    /**
     * 或签：多个审批人中任意一人审批即可通过该节点
     */
    OR_SIGN("1", "或签"),

    /**
     * 会签：多个审批人都要审批才能通过该节点
     */
    AND_SIGN("2", "会签");

    private final String code;
    private final String desc;

    ApproveModeEnum(String code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    /**
     * 根据code获取枚举
     */
    public static ApproveModeEnum getByCode(String code) {
        for (ApproveModeEnum mode : values()) {
            if (mode.getCode().equals(code)) {
                return mode;
            }
        }
        return null;
    }
}

