package com.neusoft.smart.pos.member.constants;

public enum BonusCalculatorType {

    ORDER_AMOUNT_DISCOUNT(0, "消费折扣");

    private Integer code;

    private String value;

    BonusCalculatorType(Integer code, String value) {
        this.code = code;
        this.value = value;
    }

    public Integer getCode() {
        return code;
    }

    public String getValue() {
        return value;
    }

    public static BonusCalculatorType getEnumByCode(String enumName, Integer code) {
        for (BonusCalculatorType dictEnum : BonusCalculatorType.values()) {
            if (dictEnum.name().startsWith(enumName) && code.equals(dictEnum.getCode())) {
                return dictEnum;
            }
        }
        return null;
    }
}
