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

public enum OrderTypeEnum {
   CURR_MEAL(1, "当餐点餐"),
   RESERVE_MEAL(2, "预订餐"),
   BOOK_MEAL(3, "自定义报餐"),
   SHOP(4, "商超"),
   RESERVE_SHOP(5, "预订商城"),
   ROOM(6, "包间"),
   TABLE(7, "餐桌"),
   BUS(8, "班车"),
   BOOK_MEAL_3DAY(9, "3天报餐"),
   BOOK_MEAL_7DAY(10, "7天报餐"),
   ANDROID(11, "线下消费"),
   BUFFET(12, "自助餐"),
   MOBILE_SCAN(13, "到店扫码"),
   MOBILE_SCAN_SHOP(14, "到店扫码"),
   MOBILE_TAKEAWAY(15, "美团外卖"),
   MOBILE_TAKEAWAY_STORE(16, "美团到店"),
   DEDUCT(21, "补扣"),
   OUT(22, "外部订单"),
   OTHER(99, "其他");

   private final Integer key;
   private final String desc;

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

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

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

   public static boolean isValidKey(Integer key) {
      for (OrderTypeEnum type : OrderTypeEnum.values()) {
         if (type.getKey().equals(key)) {
            return true;
         }
      }
      return false;
   }
}
