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

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Objects;

/**
 * @Author: caiwq
 * @Date: 2023/10/27 15:18
 * @Description: 预约看房状态枚举类型
 */
@Getter
@AllArgsConstructor
public enum PropertyAppointStatusEnum {

    /**
     * 待预约
     */
    NO_APPOINT(1, "待预约"),
    /**
     * 待看房
     */
    NO_REVIEWED(2, "待看房"),
    /**
     * 已看房
     */
    REVIEWED(3, "已看房"),
    /**
     * 已取消-重新预约
     */
    CANCEL_REAPPLY(4, "已取消-重新预约"),
    /**
     * 已取消-无需预约看房
     */
    CANCEL_NO_NEED(5, "已取消-无需预约看房"),
    /**
     * 放入意向库-无需看房
     */
    PUT_INTO_INTENTION(6, "放入意向库-无需看房");

    private final int value;
    private final String desc;

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

}
