package cn.hanghui.outapi.platform.tenant.entity.enums;

import cn.hanghui.outapi.platform.common.utils.Preconditions;
import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @author shisl
 * @package cn.hanghui.outapi.platform.tenant.entity.enums
 * @class PushFailedRecordTypeEnum
 * @date 2024/7/1 下午2:26
 * @description 失败记录推送类型
 */
@Getter
@AllArgsConstructor
public enum PushFailedRecordTypeEnum {

    AGE_MISMATCH(1, "年龄不符"),
    BLACKLIST(2, "黑名单"),
    ONE_N_FAIL(3, "1:N比对失败"),
    ONE_ONE_FAIL(4, "1:1比对失败"),

    ;

    private Integer code;
    private String desc;

    public static PushFailedRecordTypeEnum findByCode(Integer code) {
        if (Preconditions.isBlank(code)) {
            return null;
        }
        for (PushFailedRecordTypeEnum enumObject : values()) {
            if (enumObject.code == code.intValue()) {
                return enumObject;
            }
        }
        return null;
    }

}
