package com.bonus.canteen.core.order.common.constants;

public enum ChangeDetailTypeEnum {
   /** @deprecated */
   @Deprecated
   COME_UP(1, "上浮"),
   DISHES_DISCOUNTS(11, "菜品优惠"),
   RULE_DISCOUNT(12, "消费规则"),
   /** @deprecated */
   @Deprecated
   TOTAL_REDUCTION(13, "累计减免"),
   /** @deprecated */
   @Deprecated
   FIXED_REDUCTION(14, "固定减免"),
   /** @deprecated */
   @Deprecated
   COUPON(31, "餐券抵扣"),
   DELIVERY(41, "配送费"),
   PACKING(42, "包装费"),
   SERVICE(43, "服务费"),
   OTHER(99, "其他");

   private final Integer key;
   private final String desc;

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

   public static String getDesc(Integer key) {
      ChangeDetailTypeEnum[] var1 = values();
      int var2 = var1.length;

      for(int var3 = 0; var3 < var2; ++var3) {
         ChangeDetailTypeEnum temp = var1[var3];
         if (temp.getKey().equals(key)) {
            return temp.getDesc();
         }
      }

      return "";
   }

   public static boolean ifFromRule(Integer key) {
      return RULE_DISCOUNT.getKey().equals(key);
   }

   public static boolean ifFromOther(Integer key) {
      return OTHER.getKey().equals(key);
   }

   public static boolean ifAdditionalFee(Integer key) {
      return DELIVERY.getKey().equals(key) || PACKING.getKey().equals(key) || SERVICE.getKey().equals(key);
   }

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

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