package jnpf.enums.attendance;

import lombok.Getter;

/**
 * 发券类型（1兑换券 2抵扣券）
 */
@Getter
public enum VoucherTypeEnum {
    EXCHANGE_VOUCHER(1, "兑换券"),
    DEDUCTION_VOUCHER(2, "抵扣券");
    Integer code;
    String msg;

    VoucherTypeEnum(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public Integer getCode() {
        return code;
    }

    public static String getMsg(Integer code) {
        VoucherTypeEnum[] values = VoucherTypeEnum.values();
        for (VoucherTypeEnum value : values) {
            if (value.getCode() == code) {
                return value.getMsg();
            }
        }
        return null;
    }
}
