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 PropertyPayTypeEnum {

    BACK_DEDUCT(1, "后台抵扣"),
    AUTO_DEDUCT(2, "自动扣款"),
    USER_PAY(3, "用户支付"),
    OFFLINE_PAY(4, "线下收费"),
    ;

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