62 lines
1.9 KiB
C#
62 lines
1.9 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using LittleShop.Enums;
|
|
|
|
namespace LittleShop.DTOs;
|
|
|
|
public class BotMetricDto
|
|
{
|
|
public Guid Id { get; set; }
|
|
public Guid BotId { get; set; }
|
|
public MetricType MetricType { get; set; }
|
|
public decimal Value { get; set; }
|
|
public string Category { get; set; } = string.Empty;
|
|
public string Description { get; set; } = string.Empty;
|
|
public DateTime RecordedAt { get; set; }
|
|
public Dictionary<string, object> Metadata { get; set; } = new();
|
|
}
|
|
|
|
public class CreateBotMetricDto
|
|
{
|
|
public MetricType MetricType { get; set; }
|
|
public decimal Value { get; set; }
|
|
public string Category { get; set; } = string.Empty;
|
|
public string Description { get; set; } = string.Empty;
|
|
public Dictionary<string, object> Metadata { get; set; } = new();
|
|
}
|
|
|
|
public class BotMetricsBatchDto
|
|
{
|
|
public List<CreateBotMetricDto> Metrics { get; set; } = new();
|
|
}
|
|
|
|
public class BotMetricsSummaryDto
|
|
{
|
|
public Guid BotId { get; set; }
|
|
public string BotName { get; set; } = string.Empty;
|
|
public DateTime PeriodStart { get; set; }
|
|
public DateTime PeriodEnd { get; set; }
|
|
|
|
// Key metrics
|
|
public int TotalSessions { get; set; }
|
|
public int UniqueSessions { get; set; }
|
|
public int TotalOrders { get; set; }
|
|
public decimal TotalRevenue { get; set; }
|
|
public int TotalMessages { get; set; }
|
|
public int TotalErrors { get; set; }
|
|
public decimal AverageResponseTime { get; set; }
|
|
public decimal UptimePercentage { get; set; }
|
|
|
|
// Breakdown by type
|
|
public Dictionary<string, decimal> MetricsByType { get; set; } = new();
|
|
|
|
// Time series data (for charts)
|
|
public List<TimeSeriesDataPoint> TimeSeries { get; set; } = new();
|
|
}
|
|
|
|
public class TimeSeriesDataPoint
|
|
{
|
|
public DateTime Timestamp { get; set; }
|
|
public string Label { get; set; } = string.Empty;
|
|
public decimal Value { get; set; }
|
|
} |