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 DepositStatusEnum {
    CONFIRMED(1, "待确认"),
    REJECTED(2, "已驳回"),
    CHARGED(3, "待收费"),
    PAID(4, "已收费"),
    REFUNDED(5, "已退费"),
    FREEZE(6, "已冻结"),

    ARREARS(99, "已欠费"),    //property_deposit表不会存这个状态值，通过账单应收日期计算出来 TODO tucq 待确认

    ;

    private Integer value;
    private String desc;

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


}
