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 PropertyPayMethodEnum {
    //付款方式;1-预存款抵扣,2-钱包扣款,3-微信支付,4-现金,5-银行转账,6-第三方转账

    PREPAYMENT_PAY(1, "预存款抵扣"),
    WALLET_PAY(2, "钱包扣款"),
    WECHAT_PAY(3, "微信支付"),
    CASH_PAY(4, "现金"),
    BANK_PAY(5, "银行转账"),
    THIRD_PAY(4, "第三方转账"),
    ;

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