lingxingapi 1.1.4__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- lingxingapi/__init__.py +7 -0
- lingxingapi/ads/__init__.py +0 -0
- lingxingapi/ads/api.py +5946 -0
- lingxingapi/ads/param.py +192 -0
- lingxingapi/ads/route.py +134 -0
- lingxingapi/ads/schema.py +2615 -0
- lingxingapi/api.py +557 -0
- lingxingapi/base/__init__.py +0 -0
- lingxingapi/base/api.py +568 -0
- lingxingapi/base/param.py +59 -0
- lingxingapi/base/route.py +11 -0
- lingxingapi/base/schema.py +198 -0
- lingxingapi/basic/__init__.py +0 -0
- lingxingapi/basic/api.py +466 -0
- lingxingapi/basic/param.py +72 -0
- lingxingapi/basic/route.py +20 -0
- lingxingapi/basic/schema.py +218 -0
- lingxingapi/errors.py +152 -0
- lingxingapi/fba/__init__.py +0 -0
- lingxingapi/fba/api.py +1691 -0
- lingxingapi/fba/param.py +250 -0
- lingxingapi/fba/route.py +30 -0
- lingxingapi/fba/schema.py +987 -0
- lingxingapi/fields.py +50 -0
- lingxingapi/finance/__init__.py +0 -0
- lingxingapi/finance/api.py +3091 -0
- lingxingapi/finance/param.py +616 -0
- lingxingapi/finance/route.py +44 -0
- lingxingapi/finance/schema.py +1243 -0
- lingxingapi/product/__init__.py +0 -0
- lingxingapi/product/api.py +2643 -0
- lingxingapi/product/param.py +934 -0
- lingxingapi/product/route.py +49 -0
- lingxingapi/product/schema.py +1004 -0
- lingxingapi/purchase/__init__.py +0 -0
- lingxingapi/purchase/api.py +496 -0
- lingxingapi/purchase/param.py +126 -0
- lingxingapi/purchase/route.py +11 -0
- lingxingapi/purchase/schema.py +215 -0
- lingxingapi/sales/__init__.py +0 -0
- lingxingapi/sales/api.py +3200 -0
- lingxingapi/sales/param.py +723 -0
- lingxingapi/sales/route.py +70 -0
- lingxingapi/sales/schema.py +1718 -0
- lingxingapi/source/__init__.py +0 -0
- lingxingapi/source/api.py +1799 -0
- lingxingapi/source/param.py +176 -0
- lingxingapi/source/route.py +38 -0
- lingxingapi/source/schema.py +1011 -0
- lingxingapi/tools/__init__.py +0 -0
- lingxingapi/tools/api.py +291 -0
- lingxingapi/tools/param.py +73 -0
- lingxingapi/tools/route.py +8 -0
- lingxingapi/tools/schema.py +169 -0
- lingxingapi/utils.py +456 -0
- lingxingapi/warehourse/__init__.py +0 -0
- lingxingapi/warehourse/api.py +1778 -0
- lingxingapi/warehourse/param.py +506 -0
- lingxingapi/warehourse/route.py +28 -0
- lingxingapi/warehourse/schema.py +926 -0
- lingxingapi-1.1.4.dist-info/METADATA +73 -0
- lingxingapi-1.1.4.dist-info/RECORD +65 -0
- lingxingapi-1.1.4.dist-info/WHEEL +5 -0
- lingxingapi-1.1.4.dist-info/licenses/LICENSE +22 -0
- lingxingapi-1.1.4.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,506 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
from typing import Optional
|
|
3
|
+
from pydantic import ValidationInfo, Field, field_validator
|
|
4
|
+
from lingxingapi import utils
|
|
5
|
+
from lingxingapi.base.param import PageOffestAndLength
|
|
6
|
+
from lingxingapi.fields import NonEmptyStr, NonNegativeInt
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
# 仓库 - 仓库设置 ----------------------------------------------------------------------------------------------------------------
|
|
10
|
+
# . Warehouses
|
|
11
|
+
class Warehouses(PageOffestAndLength):
|
|
12
|
+
"""查询仓库参数"""
|
|
13
|
+
|
|
14
|
+
# 仓库类型 (1: 本地仓, 3: 海外仓, 4: 亚马逊平台仓, 6: AWD仓 | 默认: 1)
|
|
15
|
+
warehouse_type: Optional[NonNegativeInt] = Field(alias="type")
|
|
16
|
+
# 海外仓库类型 (1: 无API海外仓, 2: 有API海外仓 | 此参数只在warehouse_type=3时生效)
|
|
17
|
+
overseas_warehouse_type: Optional[NonNegativeInt] = Field(alias="sub_type")
|
|
18
|
+
# 是否已删除 (0: 未删除, 1: 已删除 | 默认: 0)
|
|
19
|
+
deleted: Optional[NonNegativeInt] = Field(alias="is_deleted")
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
# . Warehouse Bins
|
|
23
|
+
class WarehouseBins(PageOffestAndLength):
|
|
24
|
+
"""查询仓库货架(仓位)参数"""
|
|
25
|
+
|
|
26
|
+
# 仓库IDs (多个ID用逗号分隔)
|
|
27
|
+
warehouse_ids: Optional[str] = Field(None, alias="wid")
|
|
28
|
+
# 仓库货架(仓位)IDs (多个ID用逗号分隔)
|
|
29
|
+
bin_ids: Optional[str] = Field(None, alias="bin_id")
|
|
30
|
+
# 仓库货架(仓位)状态 (1: 启用, 0: 停用)
|
|
31
|
+
bin_status: Optional[NonNegativeInt] = Field(None, alias="status")
|
|
32
|
+
# 仓库货架(仓位)类型 (5: 可用, 6: 次品)
|
|
33
|
+
bin_type: Optional[NonNegativeInt] = Field(None, alias="type")
|
|
34
|
+
# 分页偏移量
|
|
35
|
+
offset: Optional[NonNegativeInt] = None
|
|
36
|
+
# 分页长度
|
|
37
|
+
length: Optional[NonNegativeInt] = Field(None, alias="limit")
|
|
38
|
+
|
|
39
|
+
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
40
|
+
@field_validator("warehouse_ids", mode="before")
|
|
41
|
+
@classmethod
|
|
42
|
+
def _validate_warehouse_ids(cls, v) -> str | None:
|
|
43
|
+
if v is None:
|
|
44
|
+
return None
|
|
45
|
+
ids = utils.validate_array_of_unsigned_int(v, "仓库ID warehouse_ids")
|
|
46
|
+
return ",".join(map(str, ids))
|
|
47
|
+
|
|
48
|
+
@field_validator("bin_ids", mode="before")
|
|
49
|
+
@classmethod
|
|
50
|
+
def _validate_bin_ids(cls, v) -> str | None:
|
|
51
|
+
if v is None:
|
|
52
|
+
return None
|
|
53
|
+
ids = utils.validate_array_of_unsigned_int(v, "仓库货架(仓位)ID bin_ids")
|
|
54
|
+
return ",".join(map(str, ids))
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
# 仓库 - 库存&流水 ---------------------------------------------------------------------------------------------------------------
|
|
58
|
+
# . FBA Inventory
|
|
59
|
+
class FbaInventory(PageOffestAndLength):
|
|
60
|
+
"""查询FBA库存参数"""
|
|
61
|
+
|
|
62
|
+
# 领星店铺ID (多个ID用逗号分隔)
|
|
63
|
+
sids: str = Field(alias="sid")
|
|
64
|
+
|
|
65
|
+
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
66
|
+
@field_validator("sids", mode="before")
|
|
67
|
+
@classmethod
|
|
68
|
+
def _validate_sids(cls, v) -> str:
|
|
69
|
+
ids = utils.validate_array_of_unsigned_int(v, "领星店铺ID sids")
|
|
70
|
+
return ",".join(map(str, ids))
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
# . FBA Inventory Detail
|
|
74
|
+
class FbaInventoryDetails(PageOffestAndLength):
|
|
75
|
+
"""查询FBA库存详情参数"""
|
|
76
|
+
|
|
77
|
+
# fmt: off
|
|
78
|
+
# 搜索字段 ('msku', 'lsku', 'fnsku', 'product_name', 'asin', 'parent_asin', 'spu', 'spu_name')
|
|
79
|
+
search_field: Optional[NonEmptyStr] = None
|
|
80
|
+
# 搜索内容
|
|
81
|
+
search_value: Optional[NonEmptyStr] = None
|
|
82
|
+
# 产品分类ID (多个ID用逗号分隔)
|
|
83
|
+
category_ids: Optional[str] = Field(None, alias="cid")
|
|
84
|
+
# 产品品牌ID (多个ID用逗号分隔)
|
|
85
|
+
brand_ids: Optional[str] = Field(None, alias="bid")
|
|
86
|
+
# 产品负责人
|
|
87
|
+
operator_ids: Optional[str] = Field(None, alias="asin_principal")
|
|
88
|
+
# 产品属性
|
|
89
|
+
attr_value_id: Optional[NonNegativeInt] = Field(None, alias="attribute")
|
|
90
|
+
# 配送方式 ('FBA', 'FBM')
|
|
91
|
+
fulfillment_channel: Optional[NonEmptyStr] = Field(None, alias="fulfillment_channel_type")
|
|
92
|
+
# 产品状态 (0: 停售, 1: 在售)
|
|
93
|
+
status: Optional[NonNegativeInt] = None
|
|
94
|
+
# 是否合并父ASIN (0: 不合并, 1: 合并 | 默认: 0) [暂时不支持]
|
|
95
|
+
# merge_parent_asin: Optional[NonNegativeInt] = Field(0, alias="is_parant_asin_merge")
|
|
96
|
+
# 是否去除零库存 (0: 保留, 1: 去除 | 默认: 0)
|
|
97
|
+
exclude_zero_stock: Optional[NonNegativeInt] = Field(0, alias="is_hide_zero_stock")
|
|
98
|
+
# 是否去除已删除产品 (0: 保留, 1: 去除 | 默认: 0)
|
|
99
|
+
exclude_deleted: Optional[NonNegativeInt] = Field(0, alias="is_contain_del_ls")
|
|
100
|
+
# 是否返回多国店铺本地可售库存信息列表数据
|
|
101
|
+
include_afn_fulfillable_local: NonNegativeInt = Field(1, alias="query_fba_storage_quantity_list")
|
|
102
|
+
# fmt: on
|
|
103
|
+
|
|
104
|
+
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
105
|
+
@field_validator("search_field", mode="before")
|
|
106
|
+
@classmethod
|
|
107
|
+
def _validate_search_field(cls, v) -> str | None:
|
|
108
|
+
if v is None:
|
|
109
|
+
return None
|
|
110
|
+
if v == "msku":
|
|
111
|
+
return "seller_sku"
|
|
112
|
+
if v == "lsku":
|
|
113
|
+
return "sku"
|
|
114
|
+
return v
|
|
115
|
+
|
|
116
|
+
@field_validator("category_ids", mode="before")
|
|
117
|
+
@classmethod
|
|
118
|
+
def _validate_category_ids(cls, v) -> str | None:
|
|
119
|
+
if v is None:
|
|
120
|
+
return None
|
|
121
|
+
ids = utils.validate_array_of_unsigned_int(v, "产品分类IDs category_ids")
|
|
122
|
+
return ",".join(map(str, ids))
|
|
123
|
+
|
|
124
|
+
@field_validator("brand_ids", mode="before")
|
|
125
|
+
@classmethod
|
|
126
|
+
def _validate_brand_ids(cls, v) -> str | None:
|
|
127
|
+
if v is None:
|
|
128
|
+
return None
|
|
129
|
+
ids = utils.validate_array_of_unsigned_int(v, "产品品牌IDs brand_ids")
|
|
130
|
+
return ",".join(map(str, ids))
|
|
131
|
+
|
|
132
|
+
@field_validator("operator_ids", mode="before")
|
|
133
|
+
@classmethod
|
|
134
|
+
def _validate_operator_ids(cls, v) -> str | None:
|
|
135
|
+
if v is None:
|
|
136
|
+
return None
|
|
137
|
+
ids = utils.validate_array_of_unsigned_int(v, "产品负责人IDs operator_ids")
|
|
138
|
+
return ",".join(map(str, ids)) if ids else None
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
# . AWD Inventory
|
|
142
|
+
class AwdInventory(PageOffestAndLength):
|
|
143
|
+
"""查询AWD仓库库存参数"""
|
|
144
|
+
|
|
145
|
+
# 搜索字段 ('msku', 'lsku', 'fnsku', 'product_name', 'asin', 'parent_asin', 'spu', 'spu_name')
|
|
146
|
+
search_field: Optional[NonEmptyStr] = None
|
|
147
|
+
# 搜索内容
|
|
148
|
+
search_value: Optional[NonEmptyStr] = None
|
|
149
|
+
# 仓库IDs (多个ID用逗号分隔)
|
|
150
|
+
warehouse_ids: Optional[str] = Field(None, alias="wids")
|
|
151
|
+
# 产品分类IDs (多个ID用逗号分隔)
|
|
152
|
+
category_ids: Optional[str] = Field(None, alias="cid")
|
|
153
|
+
# 产品品牌IDs (多个ID用逗号分隔)
|
|
154
|
+
brand_ids: Optional[str] = Field(None, alias="bid")
|
|
155
|
+
# 产品负责人IDs (多个ID用逗号分隔)
|
|
156
|
+
operator_ids: Optional[str] = Field(None, alias="asin_principal")
|
|
157
|
+
# 产品属性ID
|
|
158
|
+
attr_value_id: Optional[NonNegativeInt] = Field(None, alias="attribute")
|
|
159
|
+
# 产品状态 (0: 停售, 1: 在售)
|
|
160
|
+
status: Optional[NonNegativeInt] = None
|
|
161
|
+
# 是否去除零库存 (0: 保留, 1: 去除 | 默认: 0)
|
|
162
|
+
exclude_zero_stock: Optional[NonNegativeInt] = Field(0, alias="is_hide_zero_stock")
|
|
163
|
+
|
|
164
|
+
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
165
|
+
@field_validator("search_field", mode="before")
|
|
166
|
+
@classmethod
|
|
167
|
+
def _validate_search_field(cls, v) -> str | None:
|
|
168
|
+
if v is None:
|
|
169
|
+
return None
|
|
170
|
+
if v == "msku":
|
|
171
|
+
return "seller_sku"
|
|
172
|
+
if v == "lsku":
|
|
173
|
+
return "sku"
|
|
174
|
+
return v
|
|
175
|
+
|
|
176
|
+
@field_validator("warehouse_ids", mode="before")
|
|
177
|
+
@classmethod
|
|
178
|
+
def _validate_warehouse_ids(cls, v) -> str | None:
|
|
179
|
+
if v is None:
|
|
180
|
+
return None
|
|
181
|
+
ids = utils.validate_array_of_unsigned_int(v, "AWD仓库ID warehouse_ids")
|
|
182
|
+
return ",".join(map(str, ids))
|
|
183
|
+
|
|
184
|
+
@field_validator("category_ids", mode="before")
|
|
185
|
+
@classmethod
|
|
186
|
+
def _validate_category_ids(cls, v) -> str | None:
|
|
187
|
+
if v is None:
|
|
188
|
+
return None
|
|
189
|
+
ids = utils.validate_array_of_unsigned_int(v, "产品分类IDs category_ids")
|
|
190
|
+
return ",".join(map(str, ids))
|
|
191
|
+
|
|
192
|
+
@field_validator("brand_ids", mode="before")
|
|
193
|
+
@classmethod
|
|
194
|
+
def _validate_brand_ids(cls, v) -> str | None:
|
|
195
|
+
if v is None:
|
|
196
|
+
return None
|
|
197
|
+
ids = utils.validate_array_of_unsigned_int(v, "产品品牌IDs brand_ids")
|
|
198
|
+
return ",".join(map(str, ids))
|
|
199
|
+
|
|
200
|
+
@field_validator("operator_ids", mode="before")
|
|
201
|
+
@classmethod
|
|
202
|
+
def _validate_operator_ids(cls, v) -> str | None:
|
|
203
|
+
if v is None:
|
|
204
|
+
return None
|
|
205
|
+
ids = utils.validate_array_of_unsigned_int(v, "产品负责人IDs operator_ids")
|
|
206
|
+
return ",".join(map(str, ids))
|
|
207
|
+
|
|
208
|
+
|
|
209
|
+
# . Seller Inventory
|
|
210
|
+
class SellerInventory(PageOffestAndLength):
|
|
211
|
+
"""卖家(本地/海外)仓库库存参数"""
|
|
212
|
+
|
|
213
|
+
# 仓库IDs (多个ID用逗号分隔)
|
|
214
|
+
warehouse_ids: Optional[str] = Field(None, alias="wid")
|
|
215
|
+
# 领星本地SKU
|
|
216
|
+
lsku: Optional[NonEmptyStr] = Field(None, alias="sku")
|
|
217
|
+
|
|
218
|
+
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
219
|
+
@field_validator("warehouse_ids", mode="before")
|
|
220
|
+
@classmethod
|
|
221
|
+
def _validate_warehouse_ids(cls, v) -> str | None:
|
|
222
|
+
if v is None:
|
|
223
|
+
return None
|
|
224
|
+
ids = utils.validate_array_of_unsigned_int(v, "仓库ID warehouse_ids")
|
|
225
|
+
return ",".join(map(str, ids))
|
|
226
|
+
|
|
227
|
+
|
|
228
|
+
# . Seller Inventory Bin
|
|
229
|
+
class SellerInventoryBins(PageOffestAndLength):
|
|
230
|
+
"""卖家(本地/海外)仓库库存货架(仓位)参数"""
|
|
231
|
+
|
|
232
|
+
# 仓库IDs (多个ID用逗号分隔)
|
|
233
|
+
warehouse_ids: Optional[str] = Field(None, alias="wid")
|
|
234
|
+
# 仓库货架(仓位)类型 (多个类型用逗号分隔)
|
|
235
|
+
# (1: 待检暂存, 2: 可用暂存, 3: 次品暂存, 4: 拣货暂存, 5: 可用, 6: 次品)
|
|
236
|
+
bin_types: Optional[str] = Field(None, alias="bin_type_list")
|
|
237
|
+
|
|
238
|
+
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
239
|
+
@field_validator("warehouse_ids", mode="before")
|
|
240
|
+
@classmethod
|
|
241
|
+
def _validate_warehouse_ids(cls, v) -> str | None:
|
|
242
|
+
if v is None:
|
|
243
|
+
return None
|
|
244
|
+
ids = utils.validate_array_of_unsigned_int(v, "仓库ID warehouse_ids")
|
|
245
|
+
return ",".join(map(str, ids))
|
|
246
|
+
|
|
247
|
+
@field_validator("bin_types", mode="before")
|
|
248
|
+
@classmethod
|
|
249
|
+
def _validate_bin_types(cls, v) -> str | None:
|
|
250
|
+
if v is None:
|
|
251
|
+
return None
|
|
252
|
+
types = utils.validate_array_of_unsigned_int(v, "仓库货架(仓位)类型 bin_types")
|
|
253
|
+
return ",".join(map(str, types)) if types else None
|
|
254
|
+
|
|
255
|
+
|
|
256
|
+
# . Seller Inventory Batch
|
|
257
|
+
class SellerInventoryBatches(PageOffestAndLength):
|
|
258
|
+
"""查询卖家(本地/海外)仓库出入库批次参数"""
|
|
259
|
+
|
|
260
|
+
# fmt: off
|
|
261
|
+
# 搜索字段
|
|
262
|
+
# ('msku', 'lsku', 'fnsku', 'product_name', 'transaction_number', 'batch_number')
|
|
263
|
+
# ('source_batch_number', 'purchase_plan_number', 'purchase_number', 'receiving_number')
|
|
264
|
+
search_field: Optional[NonEmptyStr] = None
|
|
265
|
+
# 搜索内容
|
|
266
|
+
search_value: Optional[NonEmptyStr] = None
|
|
267
|
+
# 仓库IDs (多个ID用逗号分隔)
|
|
268
|
+
warehouse_ids: Optional[str] = Field(None, alias="wids")
|
|
269
|
+
# 出入库类型 (多个类型用逗号分隔)
|
|
270
|
+
# (19: 其他入库, 22: 采购入库, 24: 调拨入库, 23: 委外入库, 25: 盘盈入库)
|
|
271
|
+
# (16: 换标入库, 17: 加工入库, 18: 拆分入库, 26: 退货入库, 27: 移除入库, 45: 赠品入库)
|
|
272
|
+
transaction_types: Optional[str] = Field(None, alias="stock_in_type_list")
|
|
273
|
+
# 去除零库存 (0: 保留, 1: 去除 | 默认: 0)
|
|
274
|
+
exclude_zero_stock: Optional[NonNegativeInt] = Field(0, alias="show_zero_stock", ge=0, le=1)
|
|
275
|
+
# fmt: on
|
|
276
|
+
|
|
277
|
+
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
278
|
+
@field_validator("search_field", mode="before")
|
|
279
|
+
@classmethod
|
|
280
|
+
def _validate_search_field(cls, v) -> str | None:
|
|
281
|
+
if v is None:
|
|
282
|
+
return None
|
|
283
|
+
if v == "seller_sku":
|
|
284
|
+
return "msku"
|
|
285
|
+
if v == "lsku":
|
|
286
|
+
return "sku"
|
|
287
|
+
if v == "transaction_number":
|
|
288
|
+
return "order_sn"
|
|
289
|
+
if v == "purchase_plan_number":
|
|
290
|
+
return "purchase_plan"
|
|
291
|
+
if v == "purchase_number":
|
|
292
|
+
return "purchase_order"
|
|
293
|
+
if v == "receiving_number":
|
|
294
|
+
return "receipt_order"
|
|
295
|
+
return v
|
|
296
|
+
|
|
297
|
+
@field_validator("warehouse_ids", mode="before")
|
|
298
|
+
@classmethod
|
|
299
|
+
def _validate_warehouse_ids(cls, v) -> str | None:
|
|
300
|
+
if v is None:
|
|
301
|
+
return None
|
|
302
|
+
ids = utils.validate_array_of_unsigned_int(v, "仓库ID warehouse_ids")
|
|
303
|
+
return ",".join(map(str, ids))
|
|
304
|
+
|
|
305
|
+
@field_validator("transaction_types", mode="before")
|
|
306
|
+
@classmethod
|
|
307
|
+
def _validate_transaction_types(cls, v) -> str | None:
|
|
308
|
+
if v is None:
|
|
309
|
+
return None
|
|
310
|
+
types = utils.validate_array_of_unsigned_int(v, "出入库类型 transaction_types")
|
|
311
|
+
return ",".join(map(str, types)) if types else None
|
|
312
|
+
|
|
313
|
+
@field_validator("exclude_zero_stock", mode="after")
|
|
314
|
+
@classmethod
|
|
315
|
+
def _validate_exclude_zero_stock(cls, v: None | int) -> int | None:
|
|
316
|
+
return None if v is None else 0 if v else 1
|
|
317
|
+
|
|
318
|
+
|
|
319
|
+
# . Seller Inventory Records
|
|
320
|
+
class SellerInventoryRecords(PageOffestAndLength):
|
|
321
|
+
"""查询卖家(本地/海外)仓库出入库批次记录参数"""
|
|
322
|
+
|
|
323
|
+
# 搜索字段
|
|
324
|
+
# ('msku', 'lsku', 'fnsku', 'product_name', 'transaction_number', 'batch_number')
|
|
325
|
+
# ('source_batch_number', 'purchase_plan_number', 'purchase_number', 'receiving_number')
|
|
326
|
+
search_field: Optional[NonEmptyStr] = None
|
|
327
|
+
# 搜索内容
|
|
328
|
+
search_value: Optional[NonEmptyStr] = None
|
|
329
|
+
# 仓库IDs (多个ID用逗号分隔)
|
|
330
|
+
warehouse_ids: Optional[str] = Field(None, alias="wid_list")
|
|
331
|
+
# 出入库类型 (多个类型用逗号分隔)
|
|
332
|
+
# (19: 其他入库, 22: 采购入库, 24: 调拨入库, 23: 委外入库, 25: 盘盈入库)
|
|
333
|
+
# (16: 换标入库, 17: 加工入库, 18: 拆分入库, 47: VC-PO出库, 48: VC-DF出库)
|
|
334
|
+
# (42: 其他出库, 41: 调拨出库, 32: 委外出库, 33: 盘亏出库, 34: 换标出库)
|
|
335
|
+
# (35: 加工出库, 36: 拆分出库, 37: FBA出库, 38: FBM出库, 39: 退货出库)
|
|
336
|
+
# (26: 退货入库, 27: 移除入库, 28: 采购质检, 29: 委外质检, 71: 采购上架)
|
|
337
|
+
# (72: 委外上架, 65: WFS出库, 45: 赠品入库, 46: 赠品质检入库, 73: 赠品上架)
|
|
338
|
+
# (201: 期初成本调整, 202: 尾差成本调整)
|
|
339
|
+
transaction_types: Optional[str] = Field(None, alias="statement_type_list")
|
|
340
|
+
|
|
341
|
+
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
342
|
+
@field_validator("search_field", mode="before")
|
|
343
|
+
@classmethod
|
|
344
|
+
def _validate_search_field(cls, v) -> str | None:
|
|
345
|
+
if v is None:
|
|
346
|
+
return None
|
|
347
|
+
if v == "seller_sku":
|
|
348
|
+
return "msku"
|
|
349
|
+
if v == "lsku":
|
|
350
|
+
return "sku"
|
|
351
|
+
if v == "transaction_number":
|
|
352
|
+
return "order_sn"
|
|
353
|
+
if v == "purchase_plan_number":
|
|
354
|
+
return "purchase_plan"
|
|
355
|
+
if v == "purchase_number":
|
|
356
|
+
return "purchase_order"
|
|
357
|
+
if v == "receiving_number":
|
|
358
|
+
return "receipt_order"
|
|
359
|
+
return v
|
|
360
|
+
|
|
361
|
+
@field_validator("warehouse_ids", mode="before")
|
|
362
|
+
@classmethod
|
|
363
|
+
def _validate_warehouse_ids(cls, v) -> str | None:
|
|
364
|
+
if v is None:
|
|
365
|
+
return None
|
|
366
|
+
ids = utils.validate_array_of_unsigned_int(v, "仓库ID warehouse_ids")
|
|
367
|
+
return ",".join(map(str, ids))
|
|
368
|
+
|
|
369
|
+
@field_validator("transaction_types", mode="before")
|
|
370
|
+
@classmethod
|
|
371
|
+
def _validate_transaction_types(cls, v) -> str | None:
|
|
372
|
+
if v is None:
|
|
373
|
+
return None
|
|
374
|
+
types = utils.validate_array_of_unsigned_int(v, "出入库类型 transaction_types")
|
|
375
|
+
return ",".join(map(str, types)) if types else None
|
|
376
|
+
|
|
377
|
+
|
|
378
|
+
# . Seller Inventory Operations
|
|
379
|
+
class SellerInventoryOperations(PageOffestAndLength):
|
|
380
|
+
"""卖家(本地/海外)仓库库存操作流水参数"""
|
|
381
|
+
|
|
382
|
+
# 仓库IDs (多个ID用逗号分隔)
|
|
383
|
+
warehouse_ids: Optional[str] = Field(None, alias="wids")
|
|
384
|
+
# 出入库操作类型 (多个类型用逗号分隔)
|
|
385
|
+
# (19: 其他入库, 22: 采购入库, 24: 调拨入库, 23: 委外入库, 25: 盘盈入库)
|
|
386
|
+
# (16: 换标入库, 17: 加工入库, 18: 拆分入库, 47: VC-PO出库, 48: VC-DF出库)
|
|
387
|
+
# (42: 其他出库, 41: 调拨出库, 32: 委外出库, 33: 盘亏出库, 34: 换标出库)
|
|
388
|
+
# (35: 加工出库, 36: 拆分出库, 37: FBA出库, 38: FBM出库, 39: 退货出库)
|
|
389
|
+
# (26: 退货入库, 27: 移除入库, 28: 采购质检, 29: 委外质检, 71: 采购上架)
|
|
390
|
+
# (72: 委外上架, 65: WFS出库, 45: 赠品入库, 46: 赠品质检入库, 73: 赠品上架)
|
|
391
|
+
# (201: 期初成本调整, 202: 尾差成本调整)
|
|
392
|
+
transaction_types: Optional[str] = Field(None, alias="types")
|
|
393
|
+
# 出入库操作子类型 (多个类型用逗号分隔)
|
|
394
|
+
# (1901: 其他入库 手工其他入库, 1902: 其他入库 用户初始化, 1903: 其他入库 系统初始化)
|
|
395
|
+
# (2201: 采购入库 手工采购入库, 2202: 采购入库 采购单创建入库单, 2801: 采购质检 质检)
|
|
396
|
+
# (7101: 采购上架 PDA上架入库, 7201: 委外上架 PDA委外上架, 2401: 调拨入库 调拨单入在途)
|
|
397
|
+
# (2402: 调拨入库 调拨单收货, 2403: 调拨入库 备货单入在途, 2404: 调拨入库 备货单收货)
|
|
398
|
+
# (2405: 调拨入库 备货单入库结束到货, 2301: 委外入库 委外订单完成加工后入库)
|
|
399
|
+
# (2901: 委外质检 委外订单质检, 2501: 盘盈入库 盘点单入库, 2502: 盘盈入库 数量调整单正向)
|
|
400
|
+
# (1501: FBM退货 退货入库, 1502: FBM退货 退货入库质检, 1601: 换标入库 换标调整入库)
|
|
401
|
+
# (1701: 加工入库 加工单入库, 1702: 加工入库 委外订单加工入库, 1801: 拆分入库 拆分单入库)
|
|
402
|
+
# (2601: 自动退货入库, 2602: 手动退货入库, 2701: 移除入库, 4201: 其他出库 手工其他出库)
|
|
403
|
+
# (4101: 调拨出库 调拨单出库, 4102: 调拨出库 备货单出库, 3201: 委外出库 委外订单完成加工后出库)
|
|
404
|
+
# (3301: 盘亏出库 盘点单出库, 3302: 盘亏出库 数量调整单负向, 3401: 换标出库 换标调整出库)
|
|
405
|
+
# (3501: 加工出库 加工单出库, 3502: 加工出库 委外订单加工出库, 3601: 拆分出库 拆分单出库)
|
|
406
|
+
# (3701: FBA出库 发货单出库, 3702: FBA出库 手工FBA出库, 3801: FBM出库 销售出库单)
|
|
407
|
+
# (3901: 退货出库 手工退货出库, 3902: 退货出库 采购单生成的退货出库单, 10001: 库存锁定-出库)
|
|
408
|
+
# (10002: 库存锁定-调拨, 10003: 库存锁定-调整, 10004: 库存锁定-加工, 10005: 库存锁定-加工计划)
|
|
409
|
+
# (10006: 库存锁定-拆分, 10007: 库存锁定-海外备货, 10008: 库存锁定-发货, 10009: 库存锁定-自发货)
|
|
410
|
+
# (10010: 库存锁定-主动释放, 10012: 库存锁定-发货拣货, 10013: 库存锁定-发货计划)
|
|
411
|
+
# (10014: 库存锁定-WFS库存调整, 10011: 仓位转移和一键上架)
|
|
412
|
+
transaction_sub_types: Optional[str] = Field(None, alias="sub_types")
|
|
413
|
+
# 操作开始日期, 闭合区间
|
|
414
|
+
start_date: Optional[NonEmptyStr] = None
|
|
415
|
+
# 操作结束日期, 闭合区间
|
|
416
|
+
end_date: Optional[NonEmptyStr] = None
|
|
417
|
+
|
|
418
|
+
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
419
|
+
@field_validator("warehouse_ids", mode="before")
|
|
420
|
+
@classmethod
|
|
421
|
+
def _validate_warehouse_ids(cls, v) -> str | None:
|
|
422
|
+
if v is None:
|
|
423
|
+
return None
|
|
424
|
+
ids = utils.validate_array_of_unsigned_int(v, "仓库ID warehouse_ids")
|
|
425
|
+
return ",".join(map(str, ids))
|
|
426
|
+
|
|
427
|
+
@field_validator("transaction_types", mode="before")
|
|
428
|
+
@classmethod
|
|
429
|
+
def _validate_transaction_types(cls, v) -> str | None:
|
|
430
|
+
if v is None:
|
|
431
|
+
return None
|
|
432
|
+
types = utils.validate_array_of_unsigned_int(v, "出入库类型 transaction_types")
|
|
433
|
+
return ",".join(map(str, types)) if types else None
|
|
434
|
+
|
|
435
|
+
@field_validator("transaction_sub_types", mode="before")
|
|
436
|
+
@classmethod
|
|
437
|
+
def _validate_transaction_sub_types(cls, v) -> str | None:
|
|
438
|
+
if v is None:
|
|
439
|
+
return None
|
|
440
|
+
sub_types = utils.validate_array_of_unsigned_int(
|
|
441
|
+
v, "出入库子类型 transaction_sub_types"
|
|
442
|
+
)
|
|
443
|
+
return ",".join(map(str, sub_types)) if sub_types else None
|
|
444
|
+
|
|
445
|
+
@field_validator("start_date", "end_date", mode="before")
|
|
446
|
+
@classmethod
|
|
447
|
+
def _validate_date(cls, v: Optional[str], info: ValidationInfo) -> str | None:
|
|
448
|
+
if v is None:
|
|
449
|
+
return None
|
|
450
|
+
dt = utils.validate_datetime(v, False, "操作时间 %s" % info.field_name)
|
|
451
|
+
return "%04d-%02d-%02d" % (dt.year, dt.month, dt.day)
|
|
452
|
+
|
|
453
|
+
|
|
454
|
+
# . Seller Inventory Bin Records
|
|
455
|
+
class SellerInventoryBinRecords(PageOffestAndLength):
|
|
456
|
+
"""查询卖家(本地/海外)仓库货架(仓位)出入流水参数"""
|
|
457
|
+
|
|
458
|
+
# 仓库IDs (多个ID用逗号分隔)
|
|
459
|
+
warehouse_ids: Optional[str] = Field(None, alias="wid")
|
|
460
|
+
# 出入库类型 (多个类型用逗号分隔)
|
|
461
|
+
# (16: 换标入库, 17: 加工入库, 18: 拆分入库, 19: 其他入库, 22: 采购入库, 23: 委外入库)
|
|
462
|
+
# (24: 调拨入库, 25: 盘盈入库, 26: 退货入库, 27: 移除入库, 28: 采购质检, 29: 委外质检)
|
|
463
|
+
# (32: 委外出库, 33: 盘亏出库, 34: 换标出库, 35: 加工出库, 36: 拆分出库, 37: FBA出库)
|
|
464
|
+
# (38: FBM出库, 39: 退货出库, 41: 调拨出库, 42: 其他出库, 65: WFS出库, 71: 采购上架)
|
|
465
|
+
# (72: 委外上架, 100: 库存调整, 200: 成本补录, 30001: 已撤销)
|
|
466
|
+
transaction_types: Optional[str] = Field(None, alias="type")
|
|
467
|
+
# 仓库货架(仓位)类型 (多个类型用逗号分隔)
|
|
468
|
+
# (1: 待检暂存, 2: 可用暂存, 3: 次品暂存, 4: 拣货暂存, 5: 可用, 6: 次品)
|
|
469
|
+
bin_types: Optional[str] = Field(None, alias="bin_type_list")
|
|
470
|
+
# 操作开始日期, 闭合区间
|
|
471
|
+
start_date: Optional[NonEmptyStr] = None
|
|
472
|
+
# 操作结束日期, 闭合区间
|
|
473
|
+
end_date: Optional[NonEmptyStr] = None
|
|
474
|
+
|
|
475
|
+
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
476
|
+
@field_validator("warehouse_ids", mode="before")
|
|
477
|
+
@classmethod
|
|
478
|
+
def _validate_warehouse_ids(cls, v) -> str | None:
|
|
479
|
+
if v is None:
|
|
480
|
+
return None
|
|
481
|
+
ids = utils.validate_array_of_unsigned_int(v, "仓库ID warehouse_ids")
|
|
482
|
+
return ",".join(map(str, ids))
|
|
483
|
+
|
|
484
|
+
@field_validator("transaction_types", mode="before")
|
|
485
|
+
@classmethod
|
|
486
|
+
def _validate_transaction_types(cls, v) -> str | None:
|
|
487
|
+
if v is None:
|
|
488
|
+
return None
|
|
489
|
+
types = utils.validate_array_of_unsigned_int(v, "出入库类型 transaction_types")
|
|
490
|
+
return ",".join(map(str, types)) if types else None
|
|
491
|
+
|
|
492
|
+
@field_validator("bin_types", mode="before")
|
|
493
|
+
@classmethod
|
|
494
|
+
def _validate_bin_types(cls, v) -> str | None:
|
|
495
|
+
if v is None:
|
|
496
|
+
return None
|
|
497
|
+
types = utils.validate_array_of_unsigned_int(v, "仓库货架(仓位)类型 bin_types")
|
|
498
|
+
return ",".join(map(str, types)) if types else None
|
|
499
|
+
|
|
500
|
+
@field_validator("start_date", "end_date", mode="before")
|
|
501
|
+
@classmethod
|
|
502
|
+
def _validate_date(cls, v: Optional[str], info: ValidationInfo) -> str | None:
|
|
503
|
+
if v is None:
|
|
504
|
+
return None
|
|
505
|
+
dt = utils.validate_datetime(v, False, "操作时间 %s" % info.field_name)
|
|
506
|
+
return "%04d-%02d-%02d" % (dt.year, dt.month, dt.day)
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
|
|
3
|
+
# fmt: off
|
|
4
|
+
# 仓库 - 仓库设置 ----------------------------------------------------------------------------------------------------------------
|
|
5
|
+
# https://apidoc.lingxing.com/#/docs/Warehouse/WarehouseLists
|
|
6
|
+
WAREHOUSES: str = "/erp/sc/data/local_inventory/warehouse"
|
|
7
|
+
# https://apidoc.lingxing.com/#/docs/Warehouse/warehouseBin
|
|
8
|
+
WAREHOUSE_BINS: str = "/erp/sc/routing/data/local_inventory/warehouseBin"
|
|
9
|
+
|
|
10
|
+
# 仓库 - 库存&流水 ---------------------------------------------------------------------------------------------------------------
|
|
11
|
+
# https://apidoc.lingxing.com/#/docs/Warehouse/FBAStock
|
|
12
|
+
FBA_INVENTORY: str = "/erp/sc/routing/fba/fbaStock/fbaList"
|
|
13
|
+
# https://apidoc.lingxing.com/#/docs/Warehouse/FBAStock_v2
|
|
14
|
+
FBA_INVENTORY_DETAILS: str = "/basicOpen/openapi/storage/fbaWarehouseDetail"
|
|
15
|
+
# https://apidoc.lingxing.com/#/docs/Warehouse/AwdWarehouseDetail
|
|
16
|
+
AWD_INVENTORY: str = "/basicOpen/openapi/storage/awdWarehouseDetail"
|
|
17
|
+
# https://apidoc.lingxing.com/#/docs/Warehouse/InventoryDetails
|
|
18
|
+
SELLER_INVENTORY: str = "/erp/sc/routing/data/local_inventory/inventoryDetails"
|
|
19
|
+
# https://apidoc.lingxing.com/#/docs/Warehouse/inventoryBinDetails
|
|
20
|
+
SELLER_INVENTORY_BINS: str = "/erp/sc/routing/data/local_inventory/inventoryBinDetails"
|
|
21
|
+
# https://apidoc.lingxing.com/#/docs/Warehouse/GetBatchDetailList
|
|
22
|
+
SELLER_INVENTORY_BATCHES: str = "/erp/sc/routing/data/local_inventory/getBatchDetailList"
|
|
23
|
+
# https://apidoc.lingxing.com/#/docs/Warehouse/GetBatchStatementList
|
|
24
|
+
SELLER_INVENTORY_RECORDS: str ="/erp/sc/routing/data/local_inventory/getBatchStatementList"
|
|
25
|
+
# https://apidoc.lingxing.com/#/docs/Warehouse/WarehouseStatementNew
|
|
26
|
+
SELLER_INVENTORY_OPERATIONS: str = "/erp/sc/routing/inventoryLog/WareHouseInventory/wareHouseCenterStatement"
|
|
27
|
+
# https://apidoc.lingxing.com/#/docs/Warehouse/wareHouseBinStatement
|
|
28
|
+
SELLER_INVENTORY_BIN_RECORDS: str = "/erp/sc/routing/data/local_inventory/wareHouseBinStatement"
|