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

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

public enum OrderDetailTypeEnum {
   DISHES(1, "菜品"),
   PACKAGE(2, "套餐"),
   PRODUCT(3, "商品"),
   KEYAMOUNT(4, "按键金额"),
   DEDUCT(5, "补扣");

   private final Integer key;
   private final String desc;

   private OrderDetailTypeEnum(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 (OrderDetailTypeEnum type : OrderDetailTypeEnum.values()) {
         if (type.getKey().equals(key)) {
            return true;
         }
      }
      return false;
   }
}
