lingxingapi 1.0.0__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.
Potentially problematic release.
This version of lingxingapi might be problematic. Click here for more details.
- 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 +443 -0
- lingxingapi/base/__init__.py +0 -0
- lingxingapi/base/api.py +409 -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 +212 -0
- lingxingapi/errors.py +143 -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 +411 -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.0.0.dist-info/METADATA +67 -0
- lingxingapi-1.0.0.dist-info/RECORD +65 -0
- lingxingapi-1.0.0.dist-info/WHEEL +5 -0
- lingxingapi-1.0.0.dist-info/licenses/LICENSE +22 -0
- lingxingapi-1.0.0.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
from pydantic import BaseModel, Field, field_validator
|
|
3
|
+
from lingxingapi.base import schema as base_schema
|
|
4
|
+
from lingxingapi.base.schema import ResponseV1, ResponseResult, FlattenDataList
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
# 采购 --------------------------------------------------------------------------------------------------------------------------
|
|
8
|
+
# . Supplier
|
|
9
|
+
class Supplier(BaseModel):
|
|
10
|
+
"""产品供应商"""
|
|
11
|
+
|
|
12
|
+
# 供应商ID
|
|
13
|
+
supplier_id: int
|
|
14
|
+
# 供应商名称
|
|
15
|
+
supplier_name: str
|
|
16
|
+
# 供应商编码
|
|
17
|
+
supplier_code: str
|
|
18
|
+
# 供应商是否已删除 (0: 否, 1: 是)
|
|
19
|
+
deleted: int = Field(validation_alias="is_delete")
|
|
20
|
+
# 供应商等级 [原字段 'level_text']
|
|
21
|
+
supplier_level: str = Field(validation_alias="level_text")
|
|
22
|
+
# 供应商员工人数等级 [原字段 'employees']
|
|
23
|
+
# (1: 少于50, 2: 50-150, 3: 150-500, 4: 500-1000, 5: 1000+)
|
|
24
|
+
employees_level: int = Field(validation_alias="employees")
|
|
25
|
+
# 供应商员工人数描述 [原字段 'employees_text']
|
|
26
|
+
employees_desc: str = Field(validation_alias="employees_text")
|
|
27
|
+
# 供应商网址 [原字段 'url']
|
|
28
|
+
website_url: str = Field(validation_alias="url")
|
|
29
|
+
# 供应商联系人姓名
|
|
30
|
+
contact_person: str
|
|
31
|
+
# 供应商联系电话 [原字段 'contact_number']
|
|
32
|
+
phone: str = Field(validation_alias="contact_number")
|
|
33
|
+
# 供应商联系邮箱
|
|
34
|
+
email: str
|
|
35
|
+
# 供应商联系QQ
|
|
36
|
+
qq: str
|
|
37
|
+
# 供应商传真
|
|
38
|
+
fax: str
|
|
39
|
+
# 供应商地址 [原字段 'address_full']
|
|
40
|
+
address: str = Field(validation_alias="address_full")
|
|
41
|
+
# 供应商开户银行 [原字段 'open_bank']
|
|
42
|
+
bank: str = Field(validation_alias="open_bank")
|
|
43
|
+
# 供应商银行账号户名 [原字段 'account_name']
|
|
44
|
+
bank_account_name: str = Field(validation_alias="account_name")
|
|
45
|
+
# 供应商银行账号卡好 [原字段 'bank_account_number']
|
|
46
|
+
bank_account_number: str = Field(validation_alias="bank_card_number")
|
|
47
|
+
# 供应商备注 [原字段 'remark']
|
|
48
|
+
note: str = Field(validation_alias="remark")
|
|
49
|
+
# 采购跟进人员ID列表 [原字段 'purchaser']
|
|
50
|
+
purchase_staff_ids: list[int] = Field(validation_alias="purchaser")
|
|
51
|
+
# 采购合同名称 [原字段 'pc_name']
|
|
52
|
+
purchase_contract: str = Field(validation_alias="pc_name")
|
|
53
|
+
# 采购支付方式 [原字段 'payment_method_text']
|
|
54
|
+
payment_method: str = Field(validation_alias="payment_method_text")
|
|
55
|
+
# 采购结算方式 [原字段 'settlement_method_text']
|
|
56
|
+
settlement_method: str = Field(validation_alias="settlement_method_text")
|
|
57
|
+
# 采购结算描述 [原字段 'settlement_description']
|
|
58
|
+
settlement_desc: str = Field(validation_alias="settlement_description")
|
|
59
|
+
|
|
60
|
+
@field_validator("purchase_staff_ids", mode="before")
|
|
61
|
+
@classmethod
|
|
62
|
+
def _validate_purchase_staff_ids(cls, v) -> list[int]:
|
|
63
|
+
"""验证采购跟进人员ID列表"""
|
|
64
|
+
if not v:
|
|
65
|
+
return []
|
|
66
|
+
if not isinstance(v, str):
|
|
67
|
+
raise ValueError("采购跟进人员ID purchase_staff_ids 必须是字符串")
|
|
68
|
+
return [int(x) for x in v.split(",")]
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
class Suppliers(ResponseV1):
|
|
72
|
+
"""产品供应商列表"""
|
|
73
|
+
|
|
74
|
+
data: list[Supplier]
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
# . Edit Supplier
|
|
78
|
+
class EditSupplier(BaseModel):
|
|
79
|
+
"""编辑产品供应商结果"""
|
|
80
|
+
|
|
81
|
+
# 编辑结果
|
|
82
|
+
supplier_id: int = Field(validation_alias="erp_supplier_id")
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
class EditSupplierResult(ResponseResult):
|
|
86
|
+
"""编辑产品供应商结果"""
|
|
87
|
+
|
|
88
|
+
data: EditSupplier
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
# . Purchaser
|
|
92
|
+
class Purchaser(BaseModel):
|
|
93
|
+
"""采购方主体"""
|
|
94
|
+
|
|
95
|
+
# 采购方主体ID
|
|
96
|
+
purchaser_id: int
|
|
97
|
+
# 采购方主体名称 [原字段 'name']
|
|
98
|
+
purhcaser_name: str = Field(validation_alias="name")
|
|
99
|
+
# 采购方主体联系人 [原字段 'contacter']
|
|
100
|
+
contact_person: str = Field(validation_alias="contacter")
|
|
101
|
+
# 采购方主体联系电话 [原字段 'contact_phone']
|
|
102
|
+
phone: str = Field(validation_alias="contact_phone")
|
|
103
|
+
# 采购方主体联系邮箱
|
|
104
|
+
email: str
|
|
105
|
+
# 采购方主体地址
|
|
106
|
+
address: str
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
class Purchasers(ResponseV1, FlattenDataList):
|
|
110
|
+
"""采购方主体列表"""
|
|
111
|
+
|
|
112
|
+
data: list[Purchaser]
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
# . Purchase Plan
|
|
116
|
+
class PurchasePlanFile(BaseModel):
|
|
117
|
+
"""采购计划文件"""
|
|
118
|
+
|
|
119
|
+
# 文件名称 [原字段 'name']
|
|
120
|
+
file_name: str = Field(validation_alias="name")
|
|
121
|
+
# 文件链接 [原字段 'url']
|
|
122
|
+
file_url: str = Field(validation_alias="url")
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
class PurchasePlan(BaseModel):
|
|
126
|
+
"""采购计划"""
|
|
127
|
+
|
|
128
|
+
# fmt: off
|
|
129
|
+
# 采购计划ID [原字段 'group_id']
|
|
130
|
+
plan_id: int = Field(validation_alias="group_id")
|
|
131
|
+
# 采购计划单号 [原字段 'plan_sn']
|
|
132
|
+
plan_number: str = Field(validation_alias="plan_sn")
|
|
133
|
+
# 采购计划批次号 [原字段 'ppg_sn']
|
|
134
|
+
plan_batch_number: str = Field(validation_alias="ppg_sn")
|
|
135
|
+
# 采购产品领星店铺ID
|
|
136
|
+
sid: int
|
|
137
|
+
# 采购产品的店铺名称
|
|
138
|
+
seller_name: str
|
|
139
|
+
# 采购产品销售国家 [原字段 'marketplace']
|
|
140
|
+
country: str = Field(validation_alias="marketplace")
|
|
141
|
+
# 亚马逊SKU列表 [原字段 'msku']
|
|
142
|
+
mskus: list[str] = Field(validation_alias="msku")
|
|
143
|
+
# 本地产品SKU [原字段 'sku']
|
|
144
|
+
lsku: str = Field(validation_alias="sku")
|
|
145
|
+
# 亚马逊FNSKU
|
|
146
|
+
fnsku: str
|
|
147
|
+
# 多属性产品编码
|
|
148
|
+
spu: str
|
|
149
|
+
# 多属性产品名称
|
|
150
|
+
spu_name: str
|
|
151
|
+
# 领星产品ID
|
|
152
|
+
product_id: int
|
|
153
|
+
# 本地产品名称
|
|
154
|
+
product_name: str
|
|
155
|
+
# 多属性产品属性列表 [原字段 'attribute']
|
|
156
|
+
attributes: list[base_schema.SpuProductAttribute] = Field(validation_alias="attribute")
|
|
157
|
+
# 是否是捆绑产品 [原字段 'is_combo']
|
|
158
|
+
is_bundled: int = Field(validation_alias="is_combo")
|
|
159
|
+
# 是否是辅料 [原字段 'is_aux']
|
|
160
|
+
is_auxiliary_material: int = Field(validation_alias="is_aux")
|
|
161
|
+
# 产品图片链接 [原字段 'pic_url']
|
|
162
|
+
image_url: str = Field(validation_alias="pic_url")
|
|
163
|
+
# 采购产品备注 [原字段 'remark']
|
|
164
|
+
product_note: str = Field(validation_alias="remark")
|
|
165
|
+
# 采购数量 [原字段 'quantity_plan']
|
|
166
|
+
purchase_qty: int = Field(validation_alias="quantity_plan")
|
|
167
|
+
# 采购箱子数量 [原字段 'cg_box_pcs']
|
|
168
|
+
pruchase_box_qty: int = Field(validation_alias="cg_box_pcs")
|
|
169
|
+
# 供应商ID
|
|
170
|
+
supplier_id: int
|
|
171
|
+
# 供应商名称
|
|
172
|
+
supplier_name: str
|
|
173
|
+
# 仓库ID [原字段 'wid']
|
|
174
|
+
warehouse_id: int = Field(validation_alias="wid")
|
|
175
|
+
# 仓库名称
|
|
176
|
+
warehouse_name: str
|
|
177
|
+
# 采购方主体ID
|
|
178
|
+
purchaser_id: int
|
|
179
|
+
# 采购方主体名称
|
|
180
|
+
purchaser_name: str
|
|
181
|
+
# 期望到货日期 [原字段 'expect_arrive_time']
|
|
182
|
+
expect_arrive_date: str = Field(validation_alias="expect_arrive_time")
|
|
183
|
+
# 采购计划备注 [原字段 'plan_remark']
|
|
184
|
+
purchase_note: str = Field(validation_alias="plan_remark")
|
|
185
|
+
# 采购文件 [原字段 'file']
|
|
186
|
+
purchase_files: list[PurchasePlanFile] = Field(validation_alias="file")
|
|
187
|
+
# 是否已关联加工计划 [原字段 'is_related_process_plan']
|
|
188
|
+
has_process_plan: int = Field(validation_alias="is_related_process_plan")
|
|
189
|
+
# 采购计划状态 (2: 待采购, -2: 已完成, 121: 待审批, 122: 已驳回, -3或124: 已作废)
|
|
190
|
+
status: int
|
|
191
|
+
# 采购计划状态描述 [原字段 'status_text']
|
|
192
|
+
status_desc: str = Field(validation_alias="status_text")
|
|
193
|
+
# 创建人ID [原字段 'creator_uid']
|
|
194
|
+
creator_id: int = Field(validation_alias="creator_uid")
|
|
195
|
+
# 创建人姓名 [原字段 'creator_real_name']
|
|
196
|
+
creator_name: str = Field(validation_alias="creator_real_name")
|
|
197
|
+
# 采购跟进人员ID [原字段 'cg_uid']
|
|
198
|
+
purchase_staff_id: int = Field(validation_alias="cg_uid")
|
|
199
|
+
# 采购跟进人员姓名 [原字段 'cg_opt_username']
|
|
200
|
+
purchase_staff_name: str = Field(validation_alias="cg_opt_username")
|
|
201
|
+
# 采购单负责人ID列表 [原字段 'perm_uid']
|
|
202
|
+
responsible_staff_ids: list[int] = Field(default_factory=list, validation_alias="perm_uid")
|
|
203
|
+
# 审计人员ID列表 [原字段 'audit_uids']
|
|
204
|
+
audit_staff_ids: list[int] = Field(validation_alias="audit_uids")
|
|
205
|
+
# 采购计划创建时间 (北京时间)
|
|
206
|
+
create_time: str
|
|
207
|
+
# 采购计划更新时间 (北京时间)
|
|
208
|
+
update_time: str
|
|
209
|
+
# fmt: on
|
|
210
|
+
|
|
211
|
+
|
|
212
|
+
class PurchasePlans(ResponseV1):
|
|
213
|
+
"""采购计划列表"""
|
|
214
|
+
|
|
215
|
+
data: list[PurchasePlan]
|
|
File without changes
|