package com.ruoyi.credit.service;

import java.util.List;
import java.util.concurrent.CompletableFuture;

import com.ruoyi.credit.domain.LoanConsistencyValidation;

/**
 * 异步通知处理器接口
 * 
 * @author ruoyi
 * @date 2025-12-31
 */
public interface AsyncNotificationProcessor 
{
    /**
     * 异步处理验证失败通知
     * 
     * @param validation 验证记录
     * @return 异步处理结果
     */
    CompletableFuture<Boolean> processValidationFailureNotificationAsync(LoanConsistencyValidation validation);

    /**
     * 异步批量处理验证失败通知
     * 
     * @param validations 验证记录列表
     * @return 异步处理结果
     */
    CompletableFuture<java.util.Map<String, Object>> processBatchValidationFailureNotificationsAsync(List<LoanConsistencyValidation> validations);

    /**
     * 异步处理重新验证成功通知
     * 
     * @param validation 验证记录
     * @return 异步处理结果
     */
    CompletableFuture<Boolean> processRevalidationSuccessNotificationAsync(LoanConsistencyValidation validation);

    /**
     * 异步处理系统异常告警
     * 
     * @param loanId 贷款ID
     * @param errorMessage 异常消息
     * @param alertLevel 告警级别
     * @return 异步处理结果
     */
    CompletableFuture<Boolean> processValidationExceptionAlertAsync(Long loanId, String errorMessage, String alertLevel);

    /**
     * 获取异步处理队列状态
     * 
     * @return 队列状态信息
     */
    java.util.Map<String, Object> getAsyncProcessingStatus();

    /**
     * 清理已完成的异步任务
     * 
     * @return 清理的任务数量
     */
    int cleanupCompletedTasks();
}