| | | 1 | | namespace OzonOrdersWeb.Areas.Studio2.DTOs |
| | | 2 | | { |
| | | 3 | | /// <summary> |
| | | 4 | | /// DTO для группировки заказов по продукту |
| | | 5 | | /// </summary> |
| | | 6 | | public class ProductGroupDto |
| | | 7 | | { |
| | | 8 | | public string ProductKey { get; set; } = string.Empty; |
| | | 9 | | public string Article { get; set; } = string.Empty; |
| | | 10 | | public string ProductName { get; set; } = string.Empty; |
| | | 11 | | public string? ManufacturerName { get; set; } |
| | | 12 | | public string? EtProducerName { get; set; } |
| | | 13 | | public int TotalQuantity { get; set; } |
| | | 14 | | public int TotalTrueQuantity { get; set; } |
| | | 15 | | public int TotalOrders { get; set; } |
| | | 16 | | public decimal TotalShipmentAmount { get; set; } |
| | | 17 | | public decimal AverageCheck { get; set; } |
| | | 18 | | public decimal MinPrice { get; set; } |
| | | 19 | | public decimal MaxPrice { get; set; } |
| | | 20 | | public decimal AvgPrice { get; set; } |
| | | 21 | | public decimal? MinCostPrice { get; set; } |
| | | 22 | | public decimal? MaxCostPrice { get; set; } |
| | | 23 | | public decimal? AvgCostPrice { get; set; } |
| | | 24 | | public int VerifiedOrdersCount { get; set; } |
| | | 25 | | public decimal VerifiedOrdersPercent { get; set; } |
| | | 26 | | public List<string> TopClients { get; set; } = new(); |
| | | 27 | | public string TopClientsText => string.Join(", ", TopClients); |
| | | 28 | | public decimal AvgProfit { get; set; } |
| | | 29 | | public decimal AvgDiscount { get; set; } |
| | | 30 | | } |
| | | 31 | | |
| | | 32 | | /// <summary> |
| | | 33 | | /// DTO для детализации по клиенту |
| | | 34 | | /// </summary> |
| | | 35 | | public class ClientDetailDto |
| | | 36 | | { |
| | | 37 | | public string? ClientName { get; set; } |
| | | 38 | | public int TotalOrders { get; set; } |
| | | 39 | | public int TotalQuantity { get; set; } |
| | | 40 | | public decimal TotalShipmentAmount { get; set; } |
| | | 41 | | public decimal AverageCheck { get; set; } |
| | | 42 | | public List<OrderSummaryDto> RecentOrders { get; set; } = new(); |
| | | 43 | | } |
| | | 44 | | |
| | | 45 | | /// <summary> |
| | | 46 | | /// DTO для краткой информации о заказе |
| | | 47 | | /// </summary> |
| | | 48 | | public class OrderSummaryDto |
| | | 49 | | { |
| | | 50 | | public int Id { get; set; } |
| | | 51 | | public string ShipmentNumber { get; set; } = string.Empty; |
| | | 52 | | public DateTime? ProcessingDate { get; set; } |
| | | 53 | | public int? Quantity { get; set; } |
| | | 54 | | public decimal? Price { get; set; } |
| | | 55 | | public decimal? ShipmentAmount { get; set; } |
| | | 56 | | public string? AppStatusName { get; set; } |
| | | 57 | | public string? ClientStatusName { get; set; } |
| | | 58 | | } |
| | | 59 | | |
| | | 60 | | /// <summary> |
| | | 61 | | /// DTO для фильтрации при анализе продуктов |
| | | 62 | | /// </summary> |
| | | 63 | | public class ProductAnalysisFilterDto |
| | | 64 | | { |
| | | 65 | | public DateTime? StartDate { get; set; } |
| | | 66 | | public DateTime? EndDate { get; set; } |
| | | 67 | | public int? ManufacturerId { get; set; } |
| | | 68 | | public int? AppStatusId { get; set; } |
| | | 69 | | public int? ClientStatusId { get; set; } |
| | | 70 | | public decimal? MinPrice { get; set; } |
| | | 71 | | public decimal? MaxPrice { get; set; } |
| | | 72 | | public int? OzonClientId { get; set; } |
| | | 73 | | public string? ProductKey { get; set; } |
| | | 74 | | } |
| | | 75 | | |
| | | 76 | | /// <summary> |
| | | 77 | | /// DTO для анализа по времени |
| | | 78 | | /// </summary> |
| | | 79 | | public class TimeAnalysisDto |
| | | 80 | | { |
| | | 81 | | public string Period { get; set; } = string.Empty; |
| | | 82 | | /// <summary>Год*100+месяц — ключ сортировки периода.</summary> |
| | | 83 | | public int PeriodSort { get; set; } |
| | | 84 | | public int OrdersCount { get; set; } |
| | | 85 | | public int TotalQuantity { get; set; } |
| | | 86 | | public decimal TotalAmount { get; set; } |
| | | 87 | | public decimal AverageCheck { get; set; } |
| | | 88 | | public decimal? AvgPrice { get; set; } |
| | | 89 | | public string Trend { get; set; } = string.Empty; // "up", "down", "stable" |
| | | 90 | | public List<string> TopClients { get; set; } = new(); |
| | | 91 | | } |
| | | 92 | | |
| | | 93 | | /// <summary> |
| | | 94 | | /// DTO для детального анализа продукта |
| | | 95 | | /// </summary> |
| | | 96 | | public class ProductDetailAnalysisDto |
| | | 97 | | { |
| | | 98 | | public ProductGroupDto ProductSummary { get; set; } = null!; |
| | | 99 | | public List<ClientDetailDto> ClientBreakdown { get; set; } = new(); |
| | | 100 | | public List<TimeAnalysisDto> TimeAnalysis { get; set; } = new(); |
| | | 101 | | public Dictionary<string, int> StatusDistribution { get; set; } = new(); |
| | | 102 | | public List<PriceChartPointDto> PriceChart { get; set; } = new(); |
| | | 103 | | public object ProfitByMonth { get; set; } = null!; |
| | | 104 | | public object ProfitByClient { get; set; } = null!; |
| | | 105 | | } |
| | | 106 | | |
| | | 107 | | /// <summary> |
| | | 108 | | /// DTO для точки на графике цены |
| | | 109 | | /// </summary> |
| | | 110 | | public class PriceChartPointDto |
| | | 111 | | { |
| | | 112 | | public DateTime Date { get; set; } |
| | | 113 | | public decimal Price { get; set; } |
| | | 114 | | public decimal? ShipmentAmount { get; set; } |
| | | 115 | | public decimal? Profit { get; set; } |
| | | 116 | | public int OrderId { get; set; } |
| | | 117 | | public string ShipmentNumber { get; set; } = string.Empty; |
| | | 118 | | } |
| | | 119 | | |
| | | 120 | | /// <summary> |
| | | 121 | | /// DTO для результата с пагинацией |
| | | 122 | | /// </summary> |
| | | 123 | | public class PagedResultDto<T> |
| | | 124 | | { |
| | | 125 | | public List<T> Items { get; set; } = new(); |
| | | 126 | | public int TotalCount { get; set; } |
| | | 127 | | public int PageNumber { get; set; } |
| | | 128 | | public int PageSize { get; set; } |
| | | 129 | | public int TotalPages => (int)Math.Ceiling(TotalCount / (double)PageSize); |
| | | 130 | | } |
| | | 131 | | |
| | | 132 | | /// <summary> |
| | | 133 | | /// DTO для анализа по складам |
| | | 134 | | /// </summary> |
| | | 135 | | public class WarehouseAnalysisDto |
| | | 136 | | { |
| | | 137 | | public int? WarehouseId { get; set; } |
| | | 138 | | public string WarehouseName { get; set; } = string.Empty; |
| | | 139 | | public int TotalOrders { get; set; } |
| | | 140 | | public int TotalQuantity { get; set; } |
| | | 141 | | public decimal TotalShipmentAmount { get; set; } |
| | | 142 | | public decimal AverageCheck { get; set; } |
| | | 143 | | public decimal AvgProfit { get; set; } |
| | | 144 | | public decimal AvgDiscount { get; set; } |
| | | 145 | | public List<string> TopProducts { get; set; } = new(); |
| | | 146 | | public List<string> TopClients { get; set; } = new(); |
| | | 147 | | } |
| | | 148 | | |
| | | 149 | | /// <summary> |
| | | 150 | | /// DTO для анализа по регионам (городам доставки) |
| | | 151 | | /// </summary> |
| | | 152 | | public class RegionAnalysisDto |
| | | 153 | | { |
| | | 154 | | public string RegionName { get; set; } = string.Empty; |
| | | 155 | | public int TotalOrders { get; set; } |
| | | 156 | | public int TotalQuantity { get; set; } |
| | | 157 | | public decimal TotalShipmentAmount { get; set; } |
| | | 158 | | public decimal AverageCheck { get; set; } |
| | | 159 | | public decimal AvgProfit { get; set; } |
| | | 160 | | public decimal AvgDiscount { get; set; } |
| | | 161 | | public List<string> TopProducts { get; set; } = new(); |
| | | 162 | | public List<string> TopWarehouses { get; set; } = new(); |
| | | 163 | | } |
| | | 164 | | |
| | | 165 | | /// <summary> |
| | | 166 | | /// DTO для общего анализа по складам и регионам |
| | | 167 | | /// </summary> |
| | | 168 | | public class WarehouseRegionAnalysisDto |
| | | 169 | | { |
| | | 170 | | public List<WarehouseAnalysisDto> WarehouseAnalysis { get; set; } = new(); |
| | | 171 | | public List<RegionAnalysisDto> RegionAnalysis { get; set; } = new(); |
| | | 172 | | public object WarehouseByMonth { get; set; } = null!; |
| | | 173 | | public object RegionByMonth { get; set; } = null!; |
| | | 174 | | } |
| | | 175 | | |
| | | 176 | | /// <summary> |
| | | 177 | | /// DTO для прогноза продаж |
| | | 178 | | /// </summary> |
| | | 179 | | public class SalesForecastDto |
| | | 180 | | { |
| | | 181 | | public DateTime Date { get; set; } |
| | | 182 | | public decimal ForecastedSales { get; set; } |
| | | 183 | | public string DayOfWeek { get; set; } = string.Empty; |
| | | 184 | | } |
| | | 185 | | |
| | | 186 | | /// <summary> |
| | | 187 | | /// DTO для результата анализа трендов |
| | | 188 | | /// </summary> |
| | | 189 | | public class TrendAnalysisDto |
| | | 190 | | { |
| | 0 | 191 | | public string EntityName { get; set; } = string.Empty; |
| | 0 | 192 | | public string EntityType { get; set; } = string.Empty; // product, warehouse, region |
| | 0 | 193 | | public double Slope { get; set; } |
| | 0 | 194 | | public string Direction { get; set; } = string.Empty; |
| | 0 | 195 | | public double R2 { get; set; } |
| | 0 | 196 | | public double GrowthPercentage { get; set; } |
| | 0 | 197 | | public int DataPointsCount { get; set; } |
| | 0 | 198 | | public string TrendDescription { get; set; } = string.Empty; |
| | | 199 | | } |
| | | 200 | | |
| | | 201 | | /// <summary> |
| | | 202 | | /// DTO для рекомендации по закупкам |
| | | 203 | | /// </summary> |
| | | 204 | | public class PurchaseRecommendationDto |
| | | 205 | | { |
| | | 206 | | public string Article { get; set; } = string.Empty; |
| | | 207 | | public string ProductName { get; set; } = string.Empty; |
| | | 208 | | public int CurrentStock { get; set; } |
| | | 209 | | public int RecommendedQuantity { get; set; } |
| | | 210 | | public DateTime RecommendedOrderDate { get; set; } |
| | | 211 | | public double ServiceLevel { get; set; } |
| | | 212 | | public string Priority { get; set; } = string.Empty; |
| | | 213 | | public string Reason { get; set; } = string.Empty; |
| | | 214 | | public char ABCClass { get; set; } |
| | | 215 | | public char XYZClass { get; set; } |
| | | 216 | | public double AvgDailyDemand { get; set; } |
| | | 217 | | public double SafetyStock { get; set; } |
| | | 218 | | public double ReorderPoint { get; set; } |
| | | 219 | | public string ABCDescription { get; set; } = string.Empty; |
| | | 220 | | public string XYZDescription { get; set; } = string.Empty; |
| | | 221 | | } |
| | | 222 | | |
| | | 223 | | /// <summary> |
| | | 224 | | /// DTO для общего анализа прогнозирования и трендов |
| | | 225 | | /// </summary> |
| | | 226 | | public class ForecastTrendAnalysisDto |
| | | 227 | | { |
| | | 228 | | public List<SalesForecastDto> SalesForecast { get; set; } = new(); |
| | | 229 | | public List<TrendAnalysisDto> ProductTrends { get; set; } = new(); |
| | | 230 | | public List<TrendAnalysisDto> WarehouseTrends { get; set; } = new(); |
| | | 231 | | public List<TrendAnalysisDto> RegionTrends { get; set; } = new(); |
| | | 232 | | public List<PurchaseRecommendationDto> PurchaseRecommendations { get; set; } = new(); |
| | | 233 | | } |
| | | 234 | | } |
| | | 235 | | |