package com.red.circle.other.inner.enums.sys;

import com.red.circle.tool.core.text.StringPool;
import java.util.Objects;

/**
 * 用户扣除类型枚举
 *
 * @author pengshigang on 2021/06/01
 */
public enum SysCurrencyDeductReasonEnum {

  APP(0, "APP"),
  REWARD(1, "违规"),
  INTERNAL(2, "多发"),
  WAGE(3, "操作错误"),
  OTHER(4, "其他");

  private final Integer type;
  private final String typeName;

  SysCurrencyDeductReasonEnum(Integer type, String typeName) {
    this.type = type;
    this.typeName = typeName;
  }

  public Integer getType() {
    return type;
  }

  public String getTypeName() {
    return typeName;
  }


  public static String getReasonDesc(Integer type) {
    for (SysCurrencyDeductReasonEnum rewardType : SysCurrencyDeductReasonEnum.values()) {
      if (Objects.equals(rewardType.getType(), type)) {
        return rewardType.getTypeName();
      }
    }
    return StringPool.EMPTY;
  }

}
