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

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

@Getter
@AllArgsConstructor
public enum CostBearerEnum {
    CUSTOMER(0, "客户承担"),
    COMPANY(1, "羚牛承担"),
    SELF_SETTLE(2, "自行结算");

    private final Integer type;
    private final String name;

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