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 ClientFeeModeEnum {
    ALL(1, "所有收费项目强制连续缴费"),
    FEE_ITEM(2, "允许客户选择收费项目"),
    BILL(3, "允许选择任意账单进行缴费"),
    ;

    private final int value;
    private final String desc;

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

}
