| | | 1 | | using OzonDomains.Models; |
| | | 2 | | using OzonDomains.Models.BitrixModels; |
| | | 3 | | |
| | | 4 | | namespace Services.BitrixStockServices; |
| | | 5 | | |
| | | 6 | | public sealed class BitrixOzonStockSyncDetailEntry |
| | | 7 | | { |
| | | 8 | | public string? Article { get; init; } |
| | | 9 | | public string OfferId { get; init; } = string.Empty; |
| | | 10 | | public string OzonClient { get; init; } = string.Empty; |
| | | 11 | | public string WarehouseName { get; init; } = string.Empty; |
| | | 12 | | public long WarehouseId { get; init; } |
| | | 13 | | public string? BitrixStores { get; init; } |
| | | 14 | | public int? PreviousOzonStock { get; init; } |
| | | 15 | | public int NewStock { get; init; } |
| | | 16 | | public long? ProductId { get; init; } |
| | | 17 | | public bool Success { get; init; } |
| | | 18 | | public string? ErrorMessage { get; init; } |
| | | 19 | | } |
| | | 20 | | |
| | | 21 | | public sealed class BitrixOzonStockSyncSummary |
| | | 22 | | { |
| | 0 | 23 | | public int Attempted { get; set; } |
| | 0 | 24 | | public int Succeeded { get; set; } |
| | 0 | 25 | | public int Failed { get; set; } |
| | 0 | 26 | | public int Skipped { get; set; } |
| | 0 | 27 | | public bool LimitReached { get; set; } |
| | 0 | 28 | | public List<BitrixOzonStockSyncDetailEntry> Entries { get; } = new(); |
| | | 29 | | |
| | 0 | 30 | | public void AddEntry(BitrixOzonStockSyncDetailEntry entry) => Entries.Add(entry); |
| | | 31 | | } |
| | | 32 | | |
| | | 33 | | public interface IBitrixOzonLinkedStockApiSyncService |
| | | 34 | | { |
| | | 35 | | /// <summary> |
| | | 36 | | /// Отправляет на Ozon остатки по связкам (аналог кнопки refreshOzonMain). |
| | | 37 | | /// Клиенты — только из <paramref name="ozonClients"/> (уже с учётом SelectedClientId). |
| | | 38 | | /// </summary> |
| | | 39 | | Task<BitrixOzonStockSyncSummary> SyncPendingLinkedStocksAsync( |
| | | 40 | | IReadOnlyList<RemainingStockBitrix> items, |
| | | 41 | | IReadOnlyList<OzonClient> ozonClients, |
| | | 42 | | CancellationToken cancellationToken = default); |
| | | 43 | | } |