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

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

@Getter
@AllArgsConstructor
public enum PaymentStatusEnum {
    UNPAID(0, "未支付"),
    PARTIAL(1, "部分支付"),
    PAID(2, "已支付");

    private final Integer status;
    private final String name;

    public static PaymentStatusEnum valueOf(Integer status) {
        return Arrays.stream(values())
                .filter(item -> item.getStatus().equals(status))
                .findFirst().orElse(null);
    }
}
