| | | 1 | | using Services.LabelServices; |
| | | 2 | | |
| | | 3 | | namespace OzonOrdersWeb.WebServices.Partners; |
| | | 4 | | |
| | | 5 | | public enum PartnerActionError |
| | | 6 | | { |
| | | 7 | | None, |
| | | 8 | | NotFound, |
| | | 9 | | Forbidden, |
| | | 10 | | NotOzonOrder, |
| | | 11 | | NoOzonClient, |
| | | 12 | | Failed |
| | | 13 | | } |
| | | 14 | | |
| | | 15 | | /// <summary>Итог действия партнёра над заказом. Сообщения написаны для человека, их можно показывать как есть.</summary |
| | | 16 | | public sealed record PartnerActionResult( |
| | | 17 | | bool Success, |
| | | 18 | | string Message, |
| | | 19 | | PartnerActionError Error = PartnerActionError.None, |
| | | 20 | | IReadOnlyList<string>? Reasons = null, |
| | | 21 | | string? OzonStatus = null, |
| | | 22 | | string? OzonStatusName = null) |
| | | 23 | | { |
| | | 24 | | public static PartnerActionResult Fail(PartnerActionError error, string message, IReadOnlyList<string>? reasons = nu |
| | | 25 | | new(false, message, error, reasons); |
| | | 26 | | } |
| | | 27 | | |
| | | 28 | | public sealed record PartnerActionResult<T>(PartnerActionResult Result, T? Value) |
| | | 29 | | { |
| | | 30 | | public bool Ok => Result.Success; |
| | | 31 | | } |
| | | 32 | | |
| | | 33 | | /// <summary>Товар, для которого Ozon просит страну-изготовителя перед отгрузкой.</summary> |
| | | 34 | | public sealed record PartnerCountryRequirement(long ProductId, string ProductName, string OfferId); |
| | | 35 | | |
| | | 36 | | public sealed record PartnerCountryOption(string Name, string CountryIsoCode); |
| | | 37 | | |
| | 6 | 38 | | public sealed record PartnerCountrySelection(long ProductId, string CountryIsoCode); |
| | | 39 | | |
| | | 40 | | /// <summary>Экземпляр товара, для которого Ozon просит данные (Честный ЗНАК, ГТД, РНПТ).</summary> |
| | | 41 | | public sealed record PartnerExemplarRequirement( |
| | | 42 | | string ShipmentNumber, |
| | | 43 | | long ProductId, |
| | | 44 | | string ProductName, |
| | | 45 | | string OfferId, |
| | | 46 | | long ExemplarId, |
| | | 47 | | int Index, |
| | | 48 | | int Quantity, |
| | | 49 | | bool NeedsMandatoryMark, |
| | | 50 | | bool NeedsGtd, |
| | | 51 | | bool NeedsRnpt, |
| | | 52 | | IReadOnlyList<string> Unsupported); |
| | | 53 | | |
| | | 54 | | /// <summary>Что нужно заполнить перед отгрузкой и печатью: без этого Ozon не соберёт отправление.</summary> |
| | | 55 | | public sealed record PartnerShipRequirements( |
| | | 56 | | IReadOnlyList<PartnerCountryRequirement> Countries, |
| | | 57 | | IReadOnlyList<PartnerExemplarRequirement> Exemplars); |
| | | 58 | | |
| | | 59 | | public sealed record PartnerPrintedLabel(byte[] Content, string FileName, bool Generated, bool AutoShipped); |