package co.yixiang.yshop.module.order.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.stream.Stream;

@Getter
@AllArgsConstructor
public enum RechargePackageStatusEnum {

    CLOSE(0, "关闭"),
    OPEN(1, "开启"),
    ;

    private Integer status;
    private String name;

    public static RechargePackageStatusEnum toStatus(Integer status) {
        return Stream.of(RechargePackageStatusEnum.values())
                .filter(p -> p.status.equals(status))
                .findAny()
                .orElse(null);
    }
}
