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

import cn.novalon.gym.manage.sys.audit.domain.AuditLog;
import cn.novalon.gym.manage.common.dto.PageRequest;
import cn.novalon.gym.manage.common.dto.PageResponse;
import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;

import java.time.LocalDateTime;
import java.util.List;

/**
 * 审计日志服务接口
 * 
 * @author 张翔
 * @date 2026-04-08
 */
public interface IAuditLogService {

    Mono<AuditLog> findById(Long id);

    Flux<AuditLog> findAll();

    Flux<AuditLog> findAll(boolean includeDeleted);

    Mono<PageResponse<AuditLog>> findAuditLogsByPage(PageRequest pageRequest);

    Mono<Long> count();

    Flux<AuditLog> findByEntityType(String entityType);

    Flux<AuditLog> findByEntityId(Long entityId);

    Flux<AuditLog> findByEntityTypeAndEntityId(String entityType, Long entityId);

    Flux<AuditLog> findByOperator(String operator);

    Flux<AuditLog> findByOperationType(String operationType);

    Flux<AuditLog> findByOperationTimeBetween(LocalDateTime startTime, LocalDateTime endTime);

    Flux<AuditLog> findByEntityTypeAndOperationTimeBetween(String entityType, LocalDateTime startTime,
            LocalDateTime endTime);

    Flux<AuditLog> findByOperatorAndOperationTimeBetween(String operator, LocalDateTime startTime,
            LocalDateTime endTime);

    Mono<Long> countByEntityType(String entityType);

    Mono<Long> countByOperationType(String operationType);

    Mono<Long> countByOperator(String operator);

    Mono<Long> countByOperationTimeBetween(LocalDateTime startTime, LocalDateTime endTime);

    Mono<AuditLog> save(AuditLog auditLog);

    Mono<AuditLog> saveAsync(AuditLog auditLog);

    Mono<Void> deleteById(Long id);

    Mono<Void> logicalDeleteById(Long id);

    Mono<Void> logicalDeleteByIds(List<Long> ids);

    Mono<Void> restoreById(Long id);

    Mono<Void> restoreByIds(List<Long> ids);
}
