package com.bonus.canteen.core.allocation.flow.enums;

import java.util.Arrays;
import java.util.List;

public enum FlowHolderEnum {
   SUBMIT("SUBMIT_SCOPE", "提交人"),
   LEADER("LEADER_SCOPE", "领导"),
   INTERVIEWEE("INTERVIEWEE_SCOPE", "被访人"),
   INTERVIEWEE_ORG_MANAGER("INTERVIEWEE_ORG_MANAGER_SCOPE", "被访人部门负责人");

   private final String desc;
   private final String type;

   private FlowHolderEnum(String type, String desc) {
      this.desc = desc;
      this.type = type;
   }

   public static List<FlowHolderEnum> getVisitorReservation() {
      return Arrays.asList(SUBMIT, LEADER, INTERVIEWEE, INTERVIEWEE_ORG_MANAGER);
   }

   public static FlowHolderEnum getEnumByKey(String scope) {
      FlowHolderEnum[] var1 = values();
      int var2 = var1.length;

      for(int var3 = 0; var3 < var2; ++var3) {
         FlowHolderEnum value = var1[var3];
         if (value.getType().equals(scope)) {
            return value;
         }
      }

      return null;
   }

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

   public String getType() {
      return this.type;
   }

}
