| | | 1 | | namespace Services.BitrixStockServices; |
| | | 2 | | |
| | | 3 | | /// <summary> |
| | | 4 | | /// Запрос блока строк отчёта синхронизации для AG Grid (Infinite Row Model): диапазон строк, сортировки и |
| | | 5 | | /// условия по колонкам уже нормализованы веб-слоем; SQL строится только по whitelist-каталогу |
| | | 6 | | /// <see cref="BitrixStockSyncReportGridSql"/>. |
| | | 7 | | /// </summary> |
| | | 8 | | public sealed class BitrixSyncGridLinesQuery |
| | | 9 | | { |
| | | 10 | | public int StartRow { get; set; } |
| | | 11 | | public int EndRow { get; set; } = 100; |
| | | 12 | | /// <summary>Быстрый поиск: артикул, offer_id, склады, примечание.</summary> |
| | | 13 | | public string? Search { get; set; } |
| | | 14 | | public List<BitrixSyncGridSort> Sorts { get; set; } = new(); |
| | | 15 | | public List<BitrixSyncGridCondition> Conditions { get; set; } = new(); |
| | | 16 | | /// <summary>Показывать строки 1С = 0 и Ozon = 0 (по умолчанию скрыты как шум).</summary> |
| | | 17 | | public bool ShowZero { get; set; } |
| | | 18 | | /// <summary>Только строки, где был накат цены (этап 4) — успешный или с ошибкой.</summary> |
| | | 19 | | public bool OnlyPriceChanged { get; set; } |
| | | 20 | | /// <summary>Отключённые пользователем связи складов: «clientId|склад 1С|склад Ozon».</summary> |
| | | 21 | | public List<string> ExcludedMappings { get; set; } = new(); |
| | | 22 | | } |
| | | 23 | | |
| | | 24 | | public sealed class BitrixSyncGridSort |
| | | 25 | | { |
| | | 26 | | public string ColId { get; set; } = string.Empty; |
| | | 27 | | public bool Descending { get; set; } |
| | | 28 | | } |
| | | 29 | | |
| | | 30 | | public 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> |
| | | 41 | | public 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> |
| | | 53 | | public sealed class BitrixSyncGridLineDto |
| | | 54 | | { |
| | 0 | 55 | | public long LineId { get; set; } |
| | 0 | 56 | | public int ProductId { get; set; } |
| | 0 | 57 | | public string Article { get; set; } = string.Empty; |
| | 0 | 58 | | public string? OfferId { get; set; } |
| | 0 | 59 | | public string? ManufacturerName { get; set; } |
| | 0 | 60 | | public string OneCStore { get; set; } = string.Empty; |
| | 0 | 61 | | public string OzonWarehouseName { get; set; } = string.Empty; |
| | 0 | 62 | | public long OzonWarehouseId { get; set; } |
| | 0 | 63 | | public string MappingDescription { get; set; } = string.Empty; |
| | 0 | 64 | | public int OneCQty { get; set; } |
| | 0 | 65 | | public int OzonQty { get; set; } |
| | 0 | 66 | | public int Delta { get; set; } |
| | 0 | 67 | | public int ReservedQty { get; set; } |
| | 0 | 68 | | public int? TargetQty { get; set; } |
| | 0 | 69 | | public int? OzonQtyAfter { get; set; } |
| | 0 | 70 | | public string Action { get; set; } = string.Empty; |
| | 0 | 71 | | public string ActionLabel { get; set; } = string.Empty; |
| | 0 | 72 | | public string ActionIcon { get; set; } = string.Empty; |
| | 0 | 73 | | public string RowClass { get; set; } = string.Empty; |
| | 0 | 74 | | public string? Note { get; set; } |
| | 0 | 75 | | public long? OzonProductId { get; set; } |
| | 0 | 76 | | public string? OzonApplyStatus { get; set; } |
| | 0 | 77 | | public DateTime? OzonAppliedUtc { get; set; } |
| | 0 | 78 | | public string? OzonApplyError { get; set; } |
| | 0 | 79 | | public string? OzonCleanupStatus { get; set; } |
| | 0 | 80 | | public DateTime? OzonCleanupAtUtc { get; set; } |
| | 0 | 81 | | public string? OzonCleanupError { get; set; } |
| | 0 | 82 | | public int OzonClientId { get; set; } |
| | 0 | 83 | | public string OzonClientName { get; set; } = string.Empty; |
| | 0 | 84 | | public decimal? OneCPrice { get; set; } |
| | 0 | 85 | | public decimal? PrevOneCPrice { get; set; } |
| | | 86 | | /// <summary>equal / similar / up / down / none — как фильтр «Δ C0» старой страницы.</summary> |
| | 0 | 87 | | public string DeltaC0 { get; set; } = "none"; |
| | 0 | 88 | | public bool IsArchived { get; set; } |
| | 0 | 89 | | public bool IsAutoArchived { get; set; } |
| | 0 | 90 | | public bool InPromo { get; set; } |
| | 0 | 91 | | public string? PromoName { get; set; } |
| | 0 | 92 | | public bool IsOzonOrphan { get; set; } |
| | 0 | 93 | | public string? OzonOrphanStatus { get; set; } |
| | 0 | 94 | | public int BatchMultiplier { get; set; } = 1; |
| | 0 | 95 | | public string? BatchBaseArticle { get; set; } |
| | 0 | 96 | | public decimal? BatchPushedPrice { get; set; } |
| | 0 | 97 | | public decimal? TruePrice { get; set; } |
| | 0 | 98 | | public decimal? SellingPrice { get; set; } |
| | | 99 | | /// <summary>Индекс цены, сведённый к корзинам SUPER / GREEN / YELLOW / RED / NONE.</summary> |
| | 0 | 100 | | public string ColorIndex { get; set; } = "NONE"; |
| | 0 | 101 | | public decimal? PricePushedOld { get; set; } |
| | 0 | 102 | | public decimal? PricePushedNew { get; set; } |
| | 0 | 103 | | public string? PricePushStatus { get; set; } |
| | 0 | 104 | | public string? PricePushError { get; set; } |
| | | 105 | | } |
| | | 106 | | |
| | | 107 | | public sealed class BitrixSyncGridLinesResult |
| | | 108 | | { |
| | | 109 | | public List<BitrixSyncGridLineDto> Rows { get; set; } = new(); |
| | | 110 | | public int TotalCount { get; set; } |
| | | 111 | | } |
| | | 112 | | |
| | | 113 | | public sealed class BitrixSyncGridFacetValue |
| | | 114 | | { |
| | | 115 | | public string Value { get; set; } = string.Empty; |
| | | 116 | | public int Count { get; set; } |
| | | 117 | | } |