package com.red.circle.wallet.domain.salary;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 工资类型枚举.
 */
@Getter
@AllArgsConstructor
public enum SalaryType {

  /**
   * BD工资.
   */
  BD_SALARY("BD_SALARY", "BD工资"),

  /**
   * BD-LEADER工资.
   */
  BD_LEADER_SALARY("BD_LEADER_SALARY", "BD_LEADER工资"),

  /**
   * 管理员工资
   */
  ADMIN_SALARY("ADMIN_SALARY", "ADMIN工资"),

  ;


  private final String code;
  private final String desc;

  public static SalaryType of(String code) {
    for (SalaryType type : values()) {
      if (type.getCode().equals(code)) {
        return type;
      }
    }
    return null;
  }

  public boolean isBdSalary() {
    return this == BD_SALARY;
  }

}
