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

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public enum DetailTypeEnum {
   DISHES(1, "菜品"),
   PACKAGE(2, "套餐"),
   PRODUCT(3, "商品"),
   KEYAMOUNT(4, "按键金额"),
   DEDUCT(5, "补扣"),
   BOOK(6, "报餐"),
   BUS_TICKET(7, "班车扣费"),
   BUS_STATION(8, "班车站点"),
   TAKEAWAY(9, "外卖");

   private final Integer key;
   private final String desc;

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

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

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

      return "";
   }

   public static List<Map<String, Object>> getAllEnumsList() {
      DetailTypeEnum[] enums = values();
      List<Map<String, Object>> list = new ArrayList();
      DetailTypeEnum[] var2 = enums;
      int var3 = enums.length;

      for(int var4 = 0; var4 < var3; ++var4) {
         DetailTypeEnum typeEnum = var2[var4];
         Map<String, Object> map = new HashMap();
         map.put("key", typeEnum.getKey());
         map.put("value", typeEnum.getDesc());
         list.add(map);
      }

      return list;
   }

   public static boolean isDishesCategory(Integer key) {
      return DISHES.getKey().equals(key) || PACKAGE.getKey().equals(key);
   }

   public static boolean isCustomPriceCategory(Integer key) {
      return KEYAMOUNT.getKey().equals(key) || DEDUCT.getKey().equals(key);
   }

   public static boolean isBusCategory(Integer key) {
      return BUS_TICKET.getKey().equals(key) || BUS_STATION.getKey().equals(key);
   }

   public static boolean isProductType(Integer key) {
      return PRODUCT.getKey().equals(key);
   }

   public static boolean isBookType(Integer key) {
      return BOOK.getKey().equals(key);
   }

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

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

   // $FF: synthetic method
   private static DetailTypeEnum[] $values() {
      return new DetailTypeEnum[]{DISHES, PACKAGE, PRODUCT, KEYAMOUNT, DEDUCT, BOOK, BUS_TICKET, BUS_STATION, TAKEAWAY};
   }
}
