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

import java.util.Arrays;
import java.util.Objects;

/**
 * 钱包业务状态.
 *
 * @author pengliang on 2023/7/2
 */
public enum WalletBizStatus {

  /**
   * 退款.
   */
  REIMBURSE(1);

  private final int status;

  WalletBizStatus(int status) {
    this.status = status;
  }

  public int getStatus() {
    return status;
  }

  public static WalletBizStatus toEnum(int type) {
    return Arrays.stream(WalletBizStatus.values())
        .filter(bizType -> Objects.equals(bizType.status, type))
        .findFirst()
        .orElse(null);
  }

}
