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

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 工资事件枚举.
 */
@Getter
@AllArgsConstructor
public enum SalaryEvent {

  SALARY_BD("SALARY_BD", "BD工资"),

  SALARY_BD_LEADER("SALARY_BD_LEADER", "BD_LEADER工资"),

  /**
   * 工资调整.
   */
  SALARY_ADJUST("SALARY_ADJUST", "工资调整"),

  /**
   * 提现.
   */
  WITHDRAW("WITHDRAW", "提现"),

    /**
     * 兑换
     */
  SALARY_EXCHANGE("SALARY_EXCHANGE", "工资兑换"),

    /**
     * 兑换
     */
    SALARY_TRANSFER("SALARY_TRANSFER", "工资转账"),

    /**
   * 提现退回.
   */
  WITHDRAW_REFUND("WITHDRAW_REFUND", "提现退回"),

  /**
   * 手动增加.
   */
  MANUAL_ADD("MANUAL_ADD", "手动增加"),

  /**
   * 手动扣减.
   */
  MANUAL_DEDUCT("MANUAL_DEDUCT", "手动扣减"),

  /**
   * 冻结.
   */
  FREEZE("FREEZE", "冻结"),

  /**
   * 解冻.
   */
  UNFREEZE("UNFREEZE", "解冻");

  private final String code;
  private final String desc;

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