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

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

/**
 * 后台收费模式
 */
@Getter
@AllArgsConstructor
public enum AdminFeeModeEnum {
    ALL(1, "所有收费项目强制连续缴费"),
    BILL(2, "允许选择任意账单进行收费"),
    ;

    private final int value;
    private final String desc;

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

}
