< Summary

Information
Class: Services.BitrixStockServices.BitrixSyncGridLinesQuery
Assembly: Services
File(s): /home/runner/work/Studio2Prod/Studio2Prod/AppRepository/BitrixStockServices/BitrixStockSyncReportGridModels.cs
Line coverage
100%
Covered lines: 8
Uncovered lines: 0
Coverable lines: 8
Total lines: 117
Line coverage: 100%
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_StartRow()100%11100%
get_EndRow()100%11100%
get_Search()100%11100%
get_Sorts()100%11100%
get_Conditions()100%11100%
get_ShowZero()100%11100%
get_OnlyPriceChanged()100%11100%
get_ExcludedMappings()100%11100%

File(s)

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

#LineLine coverage
 1namespace Services.BitrixStockServices;
 2
 3/// <summary>
 4/// Запрос блока строк отчёта синхронизации для AG Grid (Infinite Row Model): диапазон строк, сортировки и
 5/// условия по колонкам уже нормализованы веб-слоем; SQL строится только по whitelist-каталогу
 6/// <see cref="BitrixStockSyncReportGridSql"/>.
 7/// </summary>
 8public sealed class BitrixSyncGridLinesQuery
 9{
 210    public int StartRow { get; set; }
 2111    public int EndRow { get; set; } = 100;
 12    /// <summary>Быстрый поиск: артикул, offer_id, склады, примечание.</summary>
 2213    public string? Search { get; set; }
 5014    public List<BitrixSyncGridSort> Sorts { get; set; } = new();
 5715    public List<BitrixSyncGridCondition> Conditions { get; set; } = new();
 16    /// <summary>Показывать строки 1С = 0 и Ozon = 0 (по умолчанию скрыты как шум).</summary>
 2217    public bool ShowZero { get; set; }
 18    /// <summary>Только строки, где был накат цены (этап 4) — успешный или с ошибкой.</summary>
 2119    public bool OnlyPriceChanged { get; set; }
 20    /// <summary>Отключённые пользователем связи складов: «clientId|склад 1С|склад Ozon».</summary>
 4121    public List<string> ExcludedMappings { get; set; } = new();
 22}
 23
 24public sealed class BitrixSyncGridSort
 25{
 26    public string ColId { get; set; } = string.Empty;
 27    public bool Descending { get; set; }
 28}
 29
 30public enum BitrixSyncGridConditionKind
 31{
 32    Text,
 33    Number,
 34    Set
 35}
 36
 37/// <summary>
 38/// Условие фильтра по колонке. Операторы — как у AG Grid: contains, notContains, equals, notEqual, startsWith,
 39/// endsWith, blank, notBlank, greaterThan, greaterThanOrEqual, lessThan, lessThanOrEqual, inRange.
 40/// </summary>
 41public sealed class BitrixSyncGridCondition
 42{
 43    public string ColId { get; set; } = string.Empty;
 44    public BitrixSyncGridConditionKind Kind { get; set; }
 45    public string Operator { get; set; } = "contains";
 46    public string? Text { get; set; }
 47    public decimal? Number { get; set; }
 48    public decimal? NumberTo { get; set; }
 49    public List<string> Values { get; set; } = new();
 50}
 51
 52/// <summary>Строка отчёта для грида: поля строки + цены Ozon из снимка отчёта и вычисляемые признаки.</summary>
 53public sealed class BitrixSyncGridLineDto
 54{
 55    public long LineId { get; set; }
 56    public int ProductId { get; set; }
 57    public string Article { get; set; } = string.Empty;
 58    public string? OfferId { get; set; }
 59    public string? ManufacturerName { get; set; }
 60    public string OneCStore { get; set; } = string.Empty;
 61    public string OzonWarehouseName { get; set; } = string.Empty;
 62    public long OzonWarehouseId { get; set; }
 63    public string MappingDescription { get; set; } = string.Empty;
 64    public int OneCQty { get; set; }
 65    public int OzonQty { get; set; }
 66    public int Delta { get; set; }
 67    public int ReservedQty { get; set; }
 68    public int? TargetQty { get; set; }
 69    public int? OzonQtyAfter { get; set; }
 70    public string Action { get; set; } = string.Empty;
 71    public string ActionLabel { get; set; } = string.Empty;
 72    public string ActionIcon { get; set; } = string.Empty;
 73    public string RowClass { get; set; } = string.Empty;
 74    public string? Note { get; set; }
 75    public long? OzonProductId { get; set; }
 76    public string? OzonApplyStatus { get; set; }
 77    public DateTime? OzonAppliedUtc { get; set; }
 78    public string? OzonApplyError { get; set; }
 79    public string? OzonCleanupStatus { get; set; }
 80    public DateTime? OzonCleanupAtUtc { get; set; }
 81    public string? OzonCleanupError { get; set; }
 82    public int OzonClientId { get; set; }
 83    public string OzonClientName { get; set; } = string.Empty;
 84    public decimal? OneCPrice { get; set; }
 85    public decimal? PrevOneCPrice { get; set; }
 86    /// <summary>equal / similar / up / down / none — как фильтр «Δ C0» старой страницы.</summary>
 87    public string DeltaC0 { get; set; } = "none";
 88    public bool IsArchived { get; set; }
 89    public bool IsAutoArchived { get; set; }
 90    public bool InPromo { get; set; }
 91    public string? PromoName { get; set; }
 92    public bool IsOzonOrphan { get; set; }
 93    public string? OzonOrphanStatus { get; set; }
 94    public int BatchMultiplier { get; set; } = 1;
 95    public string? BatchBaseArticle { get; set; }
 96    public decimal? BatchPushedPrice { get; set; }
 97    public decimal? TruePrice { get; set; }
 98    public decimal? SellingPrice { get; set; }
 99    /// <summary>Индекс цены, сведённый к корзинам SUPER / GREEN / YELLOW / RED / NONE.</summary>
 100    public string ColorIndex { get; set; } = "NONE";
 101    public decimal? PricePushedOld { get; set; }
 102    public decimal? PricePushedNew { get; set; }
 103    public string? PricePushStatus { get; set; }
 104    public string? PricePushError { get; set; }
 105}
 106
 107public sealed class BitrixSyncGridLinesResult
 108{
 109    public List<BitrixSyncGridLineDto> Rows { get; set; } = new();
 110    public int TotalCount { get; set; }
 111}
 112
 113public sealed class BitrixSyncGridFacetValue
 114{
 115    public string Value { get; set; } = string.Empty;
 116    public int Count { get; set; }
 117}