package com.crm.rely.backend.core.constant;

/**
 * 速汇订单检查资料状态
 * @author gao
 * @date 2025/11/20 14:03
 */
public enum GlobalComplianceStatusEnum {
    NO_PROCESS("no_process", "无需合规性检查"),
    PENDING_CHECK("pending_check", "待提交合规性检查资料"),
    PENDING("pending", "合规性检查中"),
    APPROVED("approved", "合规性检查通过"),
    REJECTED("rejected", "合规性检查拒绝");

    private final String status;
    private final String description;

    GlobalComplianceStatusEnum(String status, String description) {
        this.status = status;
        this.description = description;
    }

    public String getStatus() {
        return status;
    }

    public String getDescription() {
        return description;
    }

    public static GlobalComplianceStatusEnum fromStatus(String status) {
        if (status == null) {
            return null;
        }
        for (GlobalComplianceStatusEnum statusEnum : values()) {
            if (statusEnum.getStatus().equals(status)) {
                return statusEnum;
            }
        }
        return null;
    }

    public static String matchStatus(String status) {
        GlobalComplianceStatusEnum statusEnum = fromStatus(status);
        return statusEnum != null ? statusEnum.getDescription() : "";
    }

}
