namespace MissionService.Domain.AggregatesModel.CheckInAggregate;

using MissionService.Domain.SeedWork;

/// <summary>
/// EN: Repository interface for UserCheckIn aggregate
/// VI: Interface repository cho UserCheckIn aggregate
/// </summary>
public interface IUserCheckInRepository : IRepository<UserCheckIn>
{
    /// <summary>
    /// EN: Add a new check-in profile / VI: Thêm hồ sơ check-in mới
    /// </summary>
    UserCheckIn Add(UserCheckIn checkIn);
    
    /// <summary>
    /// EN: Update check-in profile / VI: Cập nhật hồ sơ check-in
    /// </summary>
    void Update(UserCheckIn checkIn);
    
    /// <summary>
    /// EN: Get check-in by ID / VI: Lấy check-in theo ID
    /// </summary>
    Task<UserCheckIn?> GetByIdAsync(Guid id, CancellationToken ct = default);
    
    /// <summary>
    /// EN: Get check-in by user ID / VI: Lấy check-in theo user ID
    /// </summary>
    Task<UserCheckIn?> GetByUserIdAsync(Guid userId, CancellationToken ct = default);
    
    /// <summary>
    /// EN: Get or create check-in profile for user / VI: Lấy hoặc tạo hồ sơ check-in cho user
    /// </summary>
    Task<UserCheckIn> GetOrCreateByUserIdAsync(Guid userId, CancellationToken ct = default);
    
    /// <summary>
    /// EN: Get users with active streaks / VI: Lấy users có streak đang hoạt động
    /// </summary>
    Task<IReadOnlyList<UserCheckIn>> GetActiveStreaksAsync(int minStreak, CancellationToken ct = default);
    
    /// <summary>
    /// EN: Get top streaks leaderboard / VI: Lấy bảng xếp hạng streak cao nhất
    /// </summary>
    Task<IReadOnlyList<UserCheckIn>> GetTopStreaksAsync(int count, CancellationToken ct = default);
}
