< Summary

Information
Class: Services.BitrixStockServices.BitrixStockArticleHistoryPageDto
Assembly: Services
File(s): /home/runner/work/Studio2Prod/Studio2Prod/AppRepository/BitrixStockServices/BitrixStockSyncArticleHistoryModels.cs
Line coverage
93%
Covered lines: 15
Uncovered lines: 1
Coverable lines: 16
Total lines: 60
Line coverage: 93.7%
Branch coverage
100%
Covered branches: 4
Total branches: 4
Branch coverage: 100%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
get_Article()100%11100%
get_Page()100%11100%
get_PageSize()100%11100%
get_TotalReportCount()100%11100%
get_HasMore()100%11100%
get_Reports()100%11100%
get_HasPrices()100%11100%
get_HasPushes()100%11100%
get_IsMultiClient()100%210%
get_TotalDataRowCount()100%11100%
get_ExportTruncated()100%11100%
get_ExportReportLimit()100%11100%
get_TableColumnCount()100%44100%

File(s)

/home/runner/work/Studio2Prod/Studio2Prod/AppRepository/BitrixStockServices/BitrixStockSyncArticleHistoryModels.cs

#LineLine coverage
 1namespace Services.BitrixStockServices;
 2
 3public class BitrixStockArticleHistoryPageDto
 4{
 5    public const int DefaultExportReportLimit = 100;
 6
 4267    public string? Article { get; set; } = string.Empty;
 108    public int Page { get; set; }
 109    public int PageSize { get; set; }
 20810    public int TotalReportCount { get; set; }
 411    public bool HasMore => Page * PageSize < TotalReportCount;
 52012    public List<BitrixStockArticleHistoryReportBlockDto> Reports { get; set; } = new();
 13
 14    /// <summary>Глобально по артикулу (все отчёты) — для единой шапки таблицы при пагинации.</summary>
 20015    public bool HasPrices { get; set; }
 20016    public bool HasPushes { get; set; }
 017    public bool IsMultiClient { get; set; }
 10618    public int TotalDataRowCount => Reports.Sum(r => r.Rows.Count);
 19
 20    /// <summary>true — в выборку попали не все отчёты (лимит экспорта).</summary>
 721    public bool ExportTruncated { get; set; }
 122    public int? ExportReportLimit { get; set; }
 23
 24    public int TableColumnCount
 25    {
 26        get
 27        {
 328            var cols = 14;
 429            if (HasPrices) cols += 3;
 430            if (HasPushes) cols += 7;
 331            return cols;
 32        }
 33    }
 34}
 35
 36public 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
 49public class BitrixStockArticleHistoryRowDto
 50{
 51    public BitrixStockSyncReportWarehouseLineDto Line { get; set; } = new();
 52    public OzonPriceInfoDto? Price { get; set; }
 53}
 54
 55public class BitrixStockArticleHistoryViewModel
 56{
 57    public BitrixStockArticleHistoryPageDto Page { get; set; } = new();
 58    /// <summary>true — только блоки отчётов (для append page 2+).</summary>
 59    public bool AppendOnly { get; set; }
 60}