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

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Objects;

/**
 * @description: 住户审批设置
 * @author: 洪铭铭
 * @time: 2024/5/27 16:15
 */
@Getter
@AllArgsConstructor
public enum ResidentApproveTypeEnum {

    OWNER_AND_PROPERTY_MANAGE(1, "房屋业主+物业管理审批"),

    PROPERTY_MANAGE(2, "仅物业管理审批");

    private final int value;
    private final String desc;

    public static String getDescByCode(Integer value) {
        if (Objects.isNull(value)) {
            return "";
        }
        ResidentApproveTypeEnum[] enumArray = ResidentApproveTypeEnum.values();
        for (ResidentApproveTypeEnum e : enumArray) {
            if (e.getValue() == value) {
                return e.getDesc();
            }
        }
        return "";
    }


}
