| | | 1 | | using Newtonsoft.Json; |
| | | 2 | | |
| | | 3 | | namespace Services.ApiServices.OzonApi.Filters; |
| | | 4 | | |
| | | 5 | | /// <summary> |
| | | 6 | | /// Запрос по номеру отправления: /v6/fbs/posting/product/exemplar/create-or-get |
| | | 7 | | /// и /v5/fbs/posting/product/exemplar/status. |
| | | 8 | | /// </summary> |
| | | 9 | | public sealed class FbsExemplarPostingRequest : IRequestModel |
| | | 10 | | { |
| | | 11 | | [JsonProperty("posting_number")] |
| | | 12 | | public string PostingNumber { get; set; } = string.Empty; |
| | | 13 | | } |
| | | 14 | | |
| | | 15 | | /// <summary> |
| | | 16 | | /// Запрос к /v6/fbs/posting/product/exemplar/set. Ozon требует передавать полный набор |
| | | 17 | | /// экземпляров и продуктов отправления, а не только изменённые. |
| | | 18 | | /// </summary> |
| | | 19 | | public sealed class FbsExemplarSetRequest : IRequestModel |
| | | 20 | | { |
| | | 21 | | [JsonProperty("posting_number")] |
| | | 22 | | public string PostingNumber { get; set; } = string.Empty; |
| | | 23 | | |
| | | 24 | | [JsonProperty("multi_box_qty", NullValueHandling = NullValueHandling.Ignore)] |
| | | 25 | | public int? MultiBoxQty { get; set; } |
| | | 26 | | |
| | | 27 | | [JsonProperty("products")] |
| | | 28 | | public List<FbsExemplarSetProduct> Products { get; set; } = new(); |
| | | 29 | | } |
| | | 30 | | |
| | | 31 | | public sealed class FbsExemplarSetProduct |
| | | 32 | | { |
| | | 33 | | [JsonProperty("product_id")] |
| | | 34 | | public long ProductId { get; set; } |
| | | 35 | | |
| | | 36 | | [JsonProperty("exemplars")] |
| | | 37 | | public List<FbsExemplarSetItem> Exemplars { get; set; } = new(); |
| | | 38 | | } |
| | | 39 | | |
| | | 40 | | public sealed class FbsExemplarSetItem |
| | | 41 | | { |
| | | 42 | | [JsonProperty("exemplar_id")] |
| | 13 | 43 | | public long ExemplarId { get; set; } |
| | | 44 | | |
| | | 45 | | /// <summary> |
| | | 46 | | /// Коды маркировки. Непечатаемый разделитель GS должен уходить в JSON одинарным |
| | | 47 | | /// экранированием (Ozon отвергает удвоенный обратный слэш) — Newtonsoft делает это сам, |
| | | 48 | | /// значение из сканера трогать нельзя. |
| | | 49 | | /// </summary> |
| | | 50 | | [JsonProperty("marks", NullValueHandling = NullValueHandling.Ignore)] |
| | 12 | 51 | | public List<FbsExemplarMark>? Marks { get; set; } |
| | | 52 | | |
| | | 53 | | [JsonProperty("gtd", NullValueHandling = NullValueHandling.Ignore)] |
| | 7 | 54 | | public string? Gtd { get; set; } |
| | | 55 | | |
| | | 56 | | [JsonProperty("is_gtd_absent", NullValueHandling = NullValueHandling.Ignore)] |
| | 9 | 57 | | public bool? IsGtdAbsent { get; set; } |
| | | 58 | | |
| | | 59 | | [JsonProperty("rnpt", NullValueHandling = NullValueHandling.Ignore)] |
| | 2 | 60 | | public string? Rnpt { get; set; } |
| | | 61 | | |
| | | 62 | | [JsonProperty("is_rnpt_absent", NullValueHandling = NullValueHandling.Ignore)] |
| | 2 | 63 | | public bool? IsRnptAbsent { get; set; } |
| | | 64 | | |
| | | 65 | | [JsonProperty("weight", NullValueHandling = NullValueHandling.Ignore)] |
| | 4 | 66 | | public double? Weight { get; set; } |
| | | 67 | | } |
| | | 68 | | |
| | | 69 | | public sealed class FbsExemplarMark |
| | | 70 | | { |
| | | 71 | | [JsonProperty("mark")] |
| | | 72 | | public string Mark { get; set; } = string.Empty; |
| | | 73 | | |
| | | 74 | | /// <summary>Тип кода: mandatory_mark, jw_uin, imei и т.д.</summary> |
| | | 75 | | [JsonProperty("mark_type")] |
| | | 76 | | public string MarkType { get; set; } = OzonExemplarMarkType.MandatoryMark; |
| | | 77 | | } |
| | | 78 | | |
| | | 79 | | /// <summary>Типы кодов маркировки Ozon (поле mark_type).</summary> |
| | | 80 | | public static class OzonExemplarMarkType |
| | | 81 | | { |
| | | 82 | | public const string MandatoryMark = "mandatory_mark"; |
| | | 83 | | public const string JwUin = "jw_uin"; |
| | | 84 | | public const string Imei = "imei"; |
| | | 85 | | } |