| | | 1 | | namespace Services.BitrixStockServices; |
| | | 2 | | |
| | | 3 | | public class BitrixStockArticleHistoryPageDto |
| | | 4 | | { |
| | | 5 | | public const int DefaultExportReportLimit = 100; |
| | | 6 | | |
| | 426 | 7 | | public string? Article { get; set; } = string.Empty; |
| | 10 | 8 | | public int Page { get; set; } |
| | 10 | 9 | | public int PageSize { get; set; } |
| | 208 | 10 | | public int TotalReportCount { get; set; } |
| | 4 | 11 | | public bool HasMore => Page * PageSize < TotalReportCount; |
| | 520 | 12 | | public List<BitrixStockArticleHistoryReportBlockDto> Reports { get; set; } = new(); |
| | | 13 | | |
| | | 14 | | /// <summary>Глобально по артикулу (все отчёты) — для единой шапки таблицы при пагинации.</summary> |
| | 200 | 15 | | public bool HasPrices { get; set; } |
| | 200 | 16 | | public bool HasPushes { get; set; } |
| | 0 | 17 | | public bool IsMultiClient { get; set; } |
| | 106 | 18 | | public int TotalDataRowCount => Reports.Sum(r => r.Rows.Count); |
| | | 19 | | |
| | | 20 | | /// <summary>true — в выборку попали не все отчёты (лимит экспорта).</summary> |
| | 7 | 21 | | public bool ExportTruncated { get; set; } |
| | 1 | 22 | | public int? ExportReportLimit { get; set; } |
| | | 23 | | |
| | | 24 | | public int TableColumnCount |
| | | 25 | | { |
| | | 26 | | get |
| | | 27 | | { |
| | 3 | 28 | | var cols = 14; |
| | 4 | 29 | | if (HasPrices) cols += 3; |
| | 4 | 30 | | if (HasPushes) cols += 7; |
| | 3 | 31 | | return cols; |
| | | 32 | | } |
| | | 33 | | } |
| | | 34 | | } |
| | | 35 | | |
| | | 36 | | public class BitrixStockArticleHistoryReportBlockDto |
| | | 37 | | { |
| | | 38 | | public string? ReportId { get; set; } = string.Empty; |
| | | 39 | | public DateTime GeneratedAtUtc { get; set; } |
| | | 40 | | public string? OzonClientName { get; set; } = string.Empty; |
| | | 41 | | public List<int> MultiClientIds { get; set; } = new(); |
| | | 42 | | public Dictionary<int, string> MultiClientNames { get; set; } = new(); |
| | | 43 | | public bool IsMultiClient => MultiClientIds.Count > 1; |
| | | 44 | | public bool HasPrices { get; set; } |
| | | 45 | | public bool HasPushes { get; set; } |
| | | 46 | | public List<BitrixStockArticleHistoryRowDto> Rows { get; set; } = new(); |
| | | 47 | | } |
| | | 48 | | |
| | | 49 | | public class BitrixStockArticleHistoryRowDto |
| | | 50 | | { |
| | | 51 | | public BitrixStockSyncReportWarehouseLineDto Line { get; set; } = new(); |
| | | 52 | | public OzonPriceInfoDto? Price { get; set; } |
| | | 53 | | } |
| | | 54 | | |
| | | 55 | | public class BitrixStockArticleHistoryViewModel |
| | | 56 | | { |
| | | 57 | | public BitrixStockArticleHistoryPageDto Page { get; set; } = new(); |
| | | 58 | | /// <summary>true — только блоки отчётов (для append page 2+).</summary> |
| | | 59 | | public bool AppendOnly { get; set; } |
| | | 60 | | } |