using IamService.Domain.SeedWork;

namespace IamService.Domain.AggregatesModel.AuditAggregate;

/// <summary>
/// EN: Repository interface for AuditLog aggregate.
/// VI: Interface repository cho AuditLog aggregate.
/// </summary>
public interface IAuditLogRepository : IRepository<AuditLog>
{
    AuditLog Add(AuditLog log);
    Task<IEnumerable<AuditLog>> GetByActorIdAsync(Guid actorId, int take = 100, CancellationToken cancellationToken = default);
    Task<IEnumerable<AuditLog>> GetByResourceAsync(string resourceType, Guid resourceId, int take = 100, CancellationToken cancellationToken = default);
    Task<IEnumerable<AuditLog>> SearchAsync(
        DateTime? fromDate, DateTime? toDate, 
        int? eventTypeId = null, Guid? actorId = null, string? resourceType = null,
        int skip = 0, int take = 50,
        CancellationToken cancellationToken = default);
    Task<long> GetCountAsync(DateTime? fromDate, DateTime? toDate, CancellationToken cancellationToken = default);
}
