| | | 1 | | using Services.ApiServices.FidApi.Models; |
| | | 2 | | |
| | | 3 | | namespace Services.FeedPriceServices; |
| | | 4 | | |
| | | 5 | | /// <summary>Расшифровка цены позиции в одной сборке кабинета (план цен, сохранённый вместе со сборкой).</summary> |
| | | 6 | | public sealed class FeedExplanation |
| | | 7 | | { |
| | | 8 | | public string Cabinet { get; init; } = string.Empty; |
| | | 9 | | public string CabinetName => FeedCabinets.DisplayName(Cabinet); |
| | | 10 | | public long RunId { get; init; } |
| | | 11 | | public DateTimeOffset AssembledAt { get; init; } |
| | | 12 | | public string AssembledBy { get; init; } = string.Empty; |
| | | 13 | | |
| | | 14 | | /// <summary>В плане сборки все позиции; у старых сборок только отправленные цены, позиции может не быть.</summary> |
| | | 15 | | public bool HasFullPlan { get; init; } |
| | | 16 | | |
| | | 17 | | /// <summary>Позиция есть в плане этой сборки.</summary> |
| | | 18 | | public bool Found { get; init; } |
| | | 19 | | |
| | | 20 | | /// <summary>priced, annul-only, invalid, external, below-min.</summary> |
| | | 21 | | public string? Outcome { get; init; } |
| | | 22 | | |
| | | 23 | | /// <summary>send, unchanged, skipped-no-price, skipped-invalid, skipped-external, skipped-below-min.</summary> |
| | | 24 | | public string? Decision { get; init; } |
| | | 25 | | |
| | | 26 | | public string? Reason { get; init; } |
| | | 27 | | public decimal? FinalPrice { get; init; } |
| | | 28 | | public decimal? OldPrice { get; init; } |
| | | 29 | | public decimal? MinPrice { get; init; } |
| | | 30 | | public string? PriceWarehouse { get; init; } |
| | | 31 | | public string? PriceSupplier { get; init; } |
| | | 32 | | public decimal? PurchasePrice { get; init; } |
| | | 33 | | public int? Multiplicity { get; init; } |
| | | 34 | | |
| | | 35 | | /// <summary>Склады, обнулённые у позиции минимальной ценой склада.</summary> |
| | | 36 | | public IReadOnlyList<string> ZeroedWarehouses { get; init; } = Array.Empty<string>(); |
| | | 37 | | |
| | | 38 | | public FidPriceFormula? Formula { get; init; } |
| | | 39 | | public FidPriceOzon? Ozon { get; init; } |
| | | 40 | | |
| | | 41 | | /// <summary>Правки цен под правила Озона через «; »; null — правок не было.</summary> |
| | | 42 | | public string? Correction { get; init; } |
| | | 43 | | } |
| | | 44 | | |
| | | 45 | | /// <summary>Расшифровки позиции по сборкам кабинетов; ошибка возвращается в модели, чтобы окно не падало.</summary> |
| | | 46 | | public sealed class FeedExplanationResult |
| | | 47 | | { |
| | 37 | 48 | | public string Key { get; init; } = string.Empty; |
| | 21 | 49 | | public bool Found { get; init; } |
| | 39 | 50 | | public IReadOnlyList<FeedExplanation> Explanations { get; init; } = Array.Empty<FeedExplanation>(); |
| | 26 | 51 | | public string? Error { get; init; } |
| | | 52 | | } |
| | | 53 | | |
| | | 54 | | /// <summary>Расшифровка цены заказа: все кабинеты и выбранный по клиенту заказа.</summary> |
| | | 55 | | public sealed class FeedOrderExplanation |
| | | 56 | | { |
| | | 57 | | public FeedOrderState State { get; init; } |
| | | 58 | | public string? Key { get; init; } |
| | | 59 | | public string? Client { get; init; } |
| | | 60 | | public string? Cabinet { get; init; } |
| | | 61 | | public string? CabinetName => Cabinet is null ? null : FeedCabinets.DisplayName(Cabinet); |
| | | 62 | | |
| | | 63 | | /// <summary>Сборка кабинета клиента заказа, в плане которой есть позиция; null — выбирать не из чего.</summary> |
| | | 64 | | public FeedExplanation? Selected { get; init; } |
| | | 65 | | |
| | | 66 | | public IReadOnlyList<FeedExplanation> Explanations { get; init; } = Array.Empty<FeedExplanation>(); |
| | | 67 | | public string? Error { get; init; } |
| | | 68 | | } |