namespace TrackQrApi.Features.Analytics.Common;

public record AnalyticsSummary(
    int TotalClicks,
    int TotalScans,
    int UniqueVisitors,
    DateTime? FirstEvent,
    DateTime? LastEvent
);

public record TimeSeriesPoint(
    DateTime Date,
    int Clicks,
    int Scans
);

public record BreakdownItem(
    string Key,
    int Count,
    double Percentage
);

public record WorkspaceAnalyticsResponse(
    AnalyticsSummary Summary,
    IEnumerable<TimeSeriesPoint> TimeSeries,
    IEnumerable<BreakdownItem> TopLinks,
    IEnumerable<BreakdownItem> DeviceBreakdown,
    IEnumerable<BreakdownItem> ReferrerBreakdown,
    IEnumerable<BreakdownItem> CountryBreakdown
);

public record LinkAnalyticsResponse(
    Guid LinkId,
    string Slug,
    AnalyticsSummary Summary,
    IEnumerable<TimeSeriesPoint> TimeSeries,
    IEnumerable<BreakdownItem> DeviceBreakdown,
    IEnumerable<BreakdownItem> ReferrerBreakdown,
    IEnumerable<BreakdownItem> CountryBreakdown
);