package cn.novalon.gym.manage.sys.audit.service;

import cn.novalon.gym.manage.sys.audit.domain.AuditLog;
import cn.novalon.gym.manage.sys.audit.domain.AuditLogArchive;
import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;

import java.time.LocalDateTime;

/**
 * 审计日志归档服务接口
 * 
 * 文件定义：定义审计日志归档的业务逻辑接口
 * 涉及业务：审计日志的归档、查询、清理等操作
 * 算法：定期将历史审计日志移动到归档表
 * 
 * @author 张翔
 * @date 2026-04-14
 */
public interface IAuditLogArchiveService {
    
    Mono<Long> archiveOldLogs(int daysToKeep);
    
    Mono<AuditLogArchive> archiveLog(AuditLog auditLog);
    
    Flux<AuditLogArchive> findArchivedLogsByDateRange(LocalDateTime startDate, LocalDateTime endDate);
    
    Flux<AuditLogArchive> findArchivedLogsByEntityType(String entityType);
    
    Mono<AuditLogArchive> findArchivedLogById(Long id);
    
    Mono<Long> countArchivedLogs();
    
    Mono<Long> countArchivedLogsByDateRange(LocalDateTime startDate, LocalDateTime endDate);
    
    Mono<Void> deleteArchivedLogsOlderThan(LocalDateTime date);
    
    Mono<Long> getArchiveStatistics();
    
    Mono<Boolean> isLogArchived(Long auditLogId);
}