using AdsTrackingService.Domain.SeedWork;

namespace AdsTrackingService.Domain.AggregatesModel.AttributionAggregate;

/// <summary>
/// EN: Repository interface for Attribution aggregate.
/// VI: Interface repository cho aggregate Attribution.
/// </summary>
public interface IAttributionRepository : IRepository<Attribution>
{
    /// <summary>
    /// EN: Get attribution by conversion ID.
    /// VI: Lấy attribution theo conversion ID.
    /// </summary>
    Task<Attribution?> GetByConversionIdAsync(Guid conversionId, CancellationToken ct = default);

    /// <summary>
    /// EN: Get attributions by campaign ID.
    /// VI: Lấy attributions theo campaign ID.
    /// </summary>
    Task<IEnumerable<Attribution>> GetByCampaignIdAsync(
        Guid campaignId, 
        DateTime? from = null, 
        DateTime? to = null, 
        CancellationToken ct = default);

    /// <summary>
    /// EN: Get attributions by ad ID.
    /// VI: Lấy attributions theo ad ID.
    /// </summary>
    Task<IEnumerable<Attribution>> GetByAdIdAsync(
        Guid adId, 
        DateTime? from = null, 
        DateTime? to = null, 
        CancellationToken ct = default);

    /// <summary>
    /// EN: Get attributions by model type.
    /// VI: Lấy attributions theo loại model.
    /// </summary>
    Task<IEnumerable<Attribution>> GetByModelAsync(
        AttributionModel model, 
        CancellationToken ct = default);
}
