using System;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;

namespace Knot.Shared.Kernel.Services;

public interface IStatisticsService
{
    Task<DashboardStatsDto> GetDashboardStatsAsync(CancellationToken cancellationToken = default);
}

public class DashboardStatsDto
{
    public long StorageUsedBytes { get; set; }
    public long StorageLimitBytes { get; set; }
    public long OnlineUsers { get; set; }
    public long OfflineUsers { get; set; }
    public long TotalUsers { get; set; }
    public List<ActivityStatDto> ActivityTimeline { get; set; } = new();
    public List<TopUserDto> TopUsersByMessages { get; set; } = new();
    public List<TopUserDto> TopUsersByStorage { get; set; } = new();
}

public class ActivityStatDto
{
    public DateTime Date { get; set; }
    public long Messages { get; set; }
    public long FilesSize { get; set; }
}

public class TopUserDto
{
    public Guid UserId { get; set; }
    public string Username { get; set; } = string.Empty;
    public long Value { get; set; } // messages count or bytes
}
