| | | 1 | | using Newtonsoft.Json; |
| | | 2 | | |
| | | 3 | | namespace Services.ApiServices.OzonApi.Filters; |
| | | 4 | | |
| | | 5 | | /// <summary> |
| | | 6 | | /// Ответ API /v1/returns/list — список возвратов FBO и FBS. |
| | | 7 | | /// </summary> |
| | | 8 | | public class ReturnListResponse |
| | | 9 | | { |
| | | 10 | | [JsonProperty("returns")] |
| | 0 | 11 | | public List<OzonReturn>? Returns { get; set; } = new(); |
| | | 12 | | |
| | | 13 | | /// <summary>true, если у продавца есть следующие возвраты (для пагинации через last_id).</summary> |
| | | 14 | | [JsonProperty("has_next")] |
| | 0 | 15 | | public bool HasNext { get; set; } |
| | | 16 | | } |
| | | 17 | | |
| | | 18 | | public class OzonReturn |
| | | 19 | | { |
| | | 20 | | [JsonProperty("exemplars")] |
| | | 21 | | public List<ReturnExemplar>? Exemplars { get; set; } = new(); |
| | | 22 | | |
| | | 23 | | [JsonProperty("id")] |
| | | 24 | | public long Id { get; set; } |
| | | 25 | | |
| | | 26 | | [JsonProperty("company_id")] |
| | | 27 | | public long CompanyId { get; set; } |
| | | 28 | | |
| | | 29 | | /// <summary>Причина возврата или отмены.</summary> |
| | | 30 | | [JsonProperty("return_reason_name")] |
| | | 31 | | public string? ReturnReasonName { get; set; } |
| | | 32 | | |
| | | 33 | | /// <summary> |
| | | 34 | | /// Тип возврата: Cancellation, FullReturn, PartialReturn, ClientReturn, Unknown. |
| | | 35 | | /// </summary> |
| | | 36 | | [JsonProperty("type")] |
| | | 37 | | public string? Type { get; set; } |
| | | 38 | | |
| | | 39 | | /// <summary>Схема возврата: FBS или FBO.</summary> |
| | | 40 | | [JsonProperty("schema")] |
| | | 41 | | public string? Schema { get; set; } |
| | | 42 | | |
| | | 43 | | [JsonProperty("order_id")] |
| | | 44 | | public long OrderId { get; set; } |
| | | 45 | | |
| | | 46 | | [JsonProperty("order_number")] |
| | | 47 | | public string? OrderNumber { get; set; } |
| | | 48 | | |
| | | 49 | | /// <summary>Склад, где находится возврат.</summary> |
| | | 50 | | [JsonProperty("place")] |
| | | 51 | | public ReturnWarehouseInfo? Place { get; set; } |
| | | 52 | | |
| | | 53 | | /// <summary>Склад, куда едет возврат.</summary> |
| | | 54 | | [JsonProperty("target_place")] |
| | | 55 | | public ReturnWarehouseInfo? TargetPlace { get; set; } |
| | | 56 | | |
| | | 57 | | [JsonProperty("storage")] |
| | | 58 | | public ReturnStorage? Storage { get; set; } |
| | | 59 | | |
| | | 60 | | [JsonProperty("product")] |
| | | 61 | | public ReturnProduct? Product { get; set; } |
| | | 62 | | |
| | | 63 | | [JsonProperty("logistic")] |
| | | 64 | | public ReturnLogistic? Logistic { get; set; } |
| | | 65 | | |
| | | 66 | | [JsonProperty("visual")] |
| | | 67 | | public ReturnVisual? Visual { get; set; } |
| | | 68 | | |
| | | 69 | | [JsonProperty("additional_info")] |
| | | 70 | | public ReturnAdditionalInfo? AdditionalInfo { get; set; } |
| | | 71 | | |
| | | 72 | | /// <summary>Предыдущий идентификатор возврата.</summary> |
| | | 73 | | [JsonProperty("source_id")] |
| | | 74 | | public long? SourceId { get; set; } |
| | | 75 | | |
| | | 76 | | [JsonProperty("posting_number")] |
| | | 77 | | public string? PostingNumber { get; set; } |
| | | 78 | | |
| | | 79 | | /// <summary>Штрихкод изначального отправления.</summary> |
| | | 80 | | [JsonProperty("clearing_id")] |
| | | 81 | | public long? ClearingId { get; set; } |
| | | 82 | | |
| | | 83 | | /// <summary>Возвратный штрихкод изначального отправления.</summary> |
| | | 84 | | [JsonProperty("return_clearing_id")] |
| | | 85 | | public long? ReturnClearingId { get; set; } |
| | | 86 | | |
| | | 87 | | [JsonProperty("compensation_status")] |
| | | 88 | | public ReturnCompensationStatus? CompensationStatus { get; set; } |
| | | 89 | | } |
| | | 90 | | |
| | | 91 | | public class ReturnExemplar |
| | | 92 | | { |
| | | 93 | | [JsonProperty("id")] |
| | | 94 | | public long Id { get; set; } |
| | | 95 | | } |
| | | 96 | | |
| | | 97 | | public class ReturnWarehouseInfo |
| | | 98 | | { |
| | | 99 | | [JsonProperty("id")] |
| | | 100 | | public long Id { get; set; } |
| | | 101 | | |
| | | 102 | | [JsonProperty("name")] |
| | | 103 | | public string? Name { get; set; } |
| | | 104 | | |
| | | 105 | | [JsonProperty("address")] |
| | | 106 | | public string? Address { get; set; } |
| | | 107 | | } |
| | | 108 | | |
| | | 109 | | /// <summary>Денежная сумма с кодом валюты. Поля price в ответе Ozon могут приходить как строки.</summary> |
| | | 110 | | public class ReturnMoneyAmount |
| | | 111 | | { |
| | | 112 | | [JsonProperty("currency_code")] |
| | | 113 | | public string? CurrencyCode { get; set; } |
| | | 114 | | |
| | | 115 | | [JsonProperty("price")] |
| | | 116 | | public double Price { get; set; } |
| | | 117 | | } |
| | | 118 | | |
| | | 119 | | public class ReturnStorage |
| | | 120 | | { |
| | | 121 | | /// <summary>Стоимость хранения.</summary> |
| | | 122 | | [JsonProperty("sum")] |
| | | 123 | | public ReturnMoneyAmount? Sum { get; set; } |
| | | 124 | | |
| | | 125 | | [JsonProperty("tariffication_first_date")] |
| | | 126 | | public DateTime? TarificationFirstDate { get; set; } |
| | | 127 | | |
| | | 128 | | [JsonProperty("tariffication_start_date")] |
| | | 129 | | public DateTime? TarificationStartDate { get; set; } |
| | | 130 | | |
| | | 131 | | /// <summary>Дата, когда возврат был готов к выдаче.</summary> |
| | | 132 | | [JsonProperty("arrived_moment")] |
| | | 133 | | public DateTime? ArrivedMoment { get; set; } |
| | | 134 | | |
| | | 135 | | /// <summary>Сколько дней возврат ожидает выдачи продавцу.</summary> |
| | | 136 | | [JsonProperty("days")] |
| | | 137 | | public long Days { get; set; } |
| | | 138 | | |
| | | 139 | | [JsonProperty("utilization_sum")] |
| | | 140 | | public ReturnMoneyAmount? UtilizationSum { get; set; } |
| | | 141 | | |
| | | 142 | | [JsonProperty("utilization_forecast_date")] |
| | | 143 | | public DateTime? UtilizationForecastDate { get; set; } |
| | | 144 | | } |
| | | 145 | | |
| | | 146 | | public class ReturnProduct |
| | | 147 | | { |
| | | 148 | | /// <summary>Идентификатор товара в системе Ozon — SKU.</summary> |
| | | 149 | | [JsonProperty("sku")] |
| | | 150 | | public long Sku { get; set; } |
| | | 151 | | |
| | | 152 | | /// <summary>Идентификатор товара в системе продавца — артикул.</summary> |
| | | 153 | | [JsonProperty("offer_id")] |
| | | 154 | | public string? OfferId { get; set; } |
| | | 155 | | |
| | | 156 | | [JsonProperty("name")] |
| | | 157 | | public string? Name { get; set; } |
| | | 158 | | |
| | | 159 | | [JsonProperty("price")] |
| | | 160 | | public ReturnMoneyAmount? Price { get; set; } |
| | | 161 | | |
| | | 162 | | [JsonProperty("price_without_commission")] |
| | | 163 | | public ReturnMoneyAmount? PriceWithoutCommission { get; set; } |
| | | 164 | | |
| | | 165 | | [JsonProperty("commission_percent")] |
| | | 166 | | public double CommissionPercent { get; set; } |
| | | 167 | | |
| | | 168 | | [JsonProperty("commission")] |
| | | 169 | | public ReturnMoneyAmount? Commission { get; set; } |
| | | 170 | | |
| | | 171 | | [JsonProperty("quantity")] |
| | | 172 | | public int Quantity { get; set; } |
| | | 173 | | } |
| | | 174 | | |
| | | 175 | | public class ReturnLogistic |
| | | 176 | | { |
| | | 177 | | [JsonProperty("technical_return_moment")] |
| | | 178 | | public DateTime? TechnicalReturnMoment { get; set; } |
| | | 179 | | |
| | | 180 | | /// <summary>Дата, когда возврат прибыл на фулфилмент или выдан продавцу.</summary> |
| | | 181 | | [JsonProperty("final_moment")] |
| | | 182 | | public DateTime? FinalMoment { get; set; } |
| | | 183 | | |
| | | 184 | | [JsonProperty("cancelled_with_compensation_moment")] |
| | | 185 | | public DateTime? CancelledWithCompensationMoment { get; set; } |
| | | 186 | | |
| | | 187 | | /// <summary>Дата, когда покупатель вернул товар.</summary> |
| | | 188 | | [JsonProperty("return_date")] |
| | | 189 | | public DateTime? ReturnDate { get; set; } |
| | | 190 | | |
| | | 191 | | /// <summary>Штрихкод этикетки возврата.</summary> |
| | | 192 | | [JsonProperty("barcode")] |
| | | 193 | | public string? Barcode { get; set; } |
| | | 194 | | } |
| | | 195 | | |
| | | 196 | | /// <summary>Статус с идентификатором, отображаемым и системным именем. Используется для visual.status и compensation_st |
| | | 197 | | public class ReturnStatusInfo |
| | | 198 | | { |
| | | 199 | | [JsonProperty("id")] |
| | | 200 | | public int Id { get; set; } |
| | | 201 | | |
| | | 202 | | [JsonProperty("display_name")] |
| | | 203 | | public string? DisplayName { get; set; } |
| | | 204 | | |
| | | 205 | | /// <summary>Системное название статуса. Например: ArrivedAtReturnPlace, Approved, MoneyReturned.</summary> |
| | | 206 | | [JsonProperty("sys_name")] |
| | | 207 | | public string? SysName { get; set; } |
| | | 208 | | } |
| | | 209 | | |
| | | 210 | | public class ReturnVisual |
| | | 211 | | { |
| | | 212 | | [JsonProperty("status")] |
| | | 213 | | public ReturnStatusInfo? Status { get; set; } |
| | | 214 | | |
| | | 215 | | [JsonProperty("change_moment")] |
| | | 216 | | public DateTime? ChangeMoment { get; set; } |
| | | 217 | | } |
| | | 218 | | |
| | | 219 | | public class ReturnAdditionalInfo |
| | | 220 | | { |
| | | 221 | | /// <summary>true, если возврат вскрыт.</summary> |
| | | 222 | | [JsonProperty("is_opened")] |
| | | 223 | | public bool IsOpened { get; set; } |
| | | 224 | | |
| | | 225 | | /// <summary>true, если возврат относится к товарам «Суперэконом».</summary> |
| | | 226 | | [JsonProperty("is_super_econom")] |
| | | 227 | | public bool IsSuperEconom { get; set; } |
| | | 228 | | } |
| | | 229 | | |
| | | 230 | | public class ReturnCompensationStatus |
| | | 231 | | { |
| | | 232 | | [JsonProperty("status")] |
| | | 233 | | public ReturnStatusInfo? Status { get; set; } |
| | | 234 | | |
| | | 235 | | [JsonProperty("change_moment")] |
| | | 236 | | public DateTime? ChangeMoment { get; set; } |
| | | 237 | | } |