using DigitalData.EmailProfiler.Domain.Entities;
namespace DigitalData.EmailProfiler.Application.Interfaces.Repositories;
///
/// Repository interface for EmailHistory entity.
///
public interface IEmailHistoryRepository : IRepository
{
///
/// Get email history by message ID hash.
///
Task GetByMessageIdHashAsync(string messageIdHash, CancellationToken cancellationToken = default);
///
/// Get email history with attachments.
///
Task GetWithAttachmentsAsync(int id, CancellationToken cancellationToken = default);
///
/// Get email history by profile ID with pagination.
///
Task<(IEnumerable Items, int TotalCount)> GetByProfileIdAsync(
int profileId,
int pageNumber = 1,
int pageSize = 50,
CancellationToken cancellationToken = default);
///
/// Get failed emails that need retry.
///
Task> GetFailedEmailsAsync(int? profileId = null, CancellationToken cancellationToken = default);
///
/// Get emails processed within date range.
///
Task> GetByDateRangeAsync(
DateTime startDate,
DateTime endDate,
int? profileId = null,
CancellationToken cancellationToken = default);
///
/// Check if email with given message ID hash already exists.
///
Task IsDuplicateAsync(string messageIdHash, CancellationToken cancellationToken = default);
}