package cn.iocoder.yudao.module.energy.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;
import java.util.Arrays;

@Getter
@AllArgsConstructor
public enum FlowTypeEnum {
    RECHARGE(0, "充值"),
    DEDUCTION(1, "扣款"),
    REVERSAL(2, "冲正"),
    REMIT(3, "汇款"),
    REFUND(4, "退款");

    private final Integer type;
    private final String name;

    public static FlowTypeEnum valueOf(Integer type) {
        return Arrays.stream(values())
                .filter(item -> item.getType().equals(type))
                .findFirst().orElse(null);
    }
}
