package com.bonus.canteen.core.account.constants;

import com.bonus.canteen.core.pay.constants.PayTypeEnum;

public enum AccTradeTypeEnum {
   RECHARGE(10, "充值"),
   SUBSIDY(20, "补贴"),
   CLEAR(100, "清空"),
   WITHDRAW(30, "提现"),
   CONSUME(110, "消费"),
   CONSUME_REFUND(130, "消费退款");

   private final Integer key;
   private final String desc;

   private AccTradeTypeEnum(Integer key, String desc) {
      this.key = key;
      this.desc = desc;
   }

   public Integer getKey() {
      return this.key;
   }

   public String getDesc() {
      return this.desc;
   }

   public static String getDescByKey(Integer targetKey) {
      for (AccTradeTypeEnum tradeType : AccTradeTypeEnum.values()) {
         if (tradeType.getKey().equals(targetKey)) {
            return tradeType.getDesc();
         }
      }
      return "";
   }
}
