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

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

@Getter
@AllArgsConstructor
public enum BillStatusEnum {
    DRAFT(0, "草稿"),
    GENERATED(1, "已生成"),
    VOID(2, "已作废");

    private final Integer status;
    private final String name;

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