package com.yuchen.saas.park.api.enums.property;

import lombok.Getter;
import org.nest.springwrap.core.log.exception.ServiceException;

@Getter
public enum BillStatusEnum {
    NO_OUT(1, "未出账单"),
    YES_OUT(2, "已出账单"),
    FREEZE(3, "冻结账单"),
    PAID(4, "已结账单"),
    ;

    private final int value;
    private final String desc;

    BillStatusEnum(int i, String desc) {
        value = i;
        this.desc = desc;
    }

    public static BillStatusEnum convert(int intValue) {
        BillStatusEnum[] allValues = BillStatusEnum.values();
        for(int i = 0; i < allValues.length; i++) {
            if(allValues[i].value == intValue) {
                return allValues[i];
            }
        }
        throw new ServiceException("BillStatusEnum 非法枚举参数值");
    }

}
