< Summary

Information
Class: Services.BitrixStockServices.BitrixStockArticleHistoryReportBlockDto
Assembly: Services
File(s): /home/runner/work/Studio2Prod/Studio2Prod/AppRepository/BitrixStockServices/BitrixStockSyncArticleHistoryModels.cs
Line coverage
77%
Covered lines: 7
Uncovered lines: 2
Coverable lines: 9
Total lines: 60
Line coverage: 77.7%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
get_ReportId()100%11100%
get_GeneratedAtUtc()100%11100%
get_OzonClientName()100%11100%
get_MultiClientIds()100%11100%
get_MultiClientNames()100%11100%
get_IsMultiClient()100%11100%
get_HasPrices()100%210%
get_HasPushes()100%210%
get_Rows()100%11100%

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
 7    public string? Article { get; set; } = string.Empty;
 8    public int Page { get; set; }
 9    public int PageSize { get; set; }
 10    public int TotalReportCount { get; set; }
 11    public bool HasMore => Page * PageSize < TotalReportCount;
 12    public List<BitrixStockArticleHistoryReportBlockDto> Reports { get; set; } = new();
 13
 14    /// <summary>Глобально по артикулу (все отчёты) — для единой шапки таблицы при пагинации.</summary>
 15    public bool HasPrices { get; set; }
 16    public bool HasPushes { get; set; }
 17    public bool IsMultiClient { get; set; }
 18    public int TotalDataRowCount => Reports.Sum(r => r.Rows.Count);
 19
 20    /// <summary>true — в выборку попали не все отчёты (лимит экспорта).</summary>
 21    public bool ExportTruncated { get; set; }
 22    public int? ExportReportLimit { get; set; }
 23
 24    public int TableColumnCount
 25    {
 26        get
 27        {
 28            var cols = 14;
 29            if (HasPrices) cols += 3;
 30            if (HasPushes) cols += 7;
 31            return cols;
 32        }
 33    }
 34}
 35
 36public class BitrixStockArticleHistoryReportBlockDto
 37{
 74838    public string? ReportId { get; set; } = string.Empty;
 52239    public DateTime GeneratedAtUtc { get; set; }
 64040    public string? OzonClientName { get; set; } = string.Empty;
 49141    public List<int> MultiClientIds { get; set; } = new();
 29542    public Dictionary<int, string> MultiClientNames { get; set; } = new();
 20143    public bool IsMultiClient => MultiClientIds.Count > 1;
 044    public bool HasPrices { get; set; }
 045    public bool HasPushes { get; set; }
 95846    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}