tachain-sdk 0.1.0

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.
Files changed (82) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +9 -0
  3. data/LICENSE +21 -0
  4. data/README.md +226 -0
  5. data/Rakefile +10 -0
  6. data/git_push.sh +54 -0
  7. data/lib/tachain-sdk/api/api_declaration_api.rb +396 -0
  8. data/lib/tachain-sdk/api/api_delivery_api.rb +676 -0
  9. data/lib/tachain-sdk/api/api_enum_api.rb +94 -0
  10. data/lib/tachain-sdk/api/api_order_api.rb +846 -0
  11. data/lib/tachain-sdk/api/api_order_workflow_api.rb +170 -0
  12. data/lib/tachain-sdk/api/api_production_api.rb +466 -0
  13. data/lib/tachain-sdk/api_client.rb +397 -0
  14. data/lib/tachain-sdk/api_error.rb +58 -0
  15. data/lib/tachain-sdk/api_model_base.rb +88 -0
  16. data/lib/tachain-sdk/configuration.rb +329 -0
  17. data/lib/tachain-sdk/models/api_declaration_delete_request.rb +341 -0
  18. data/lib/tachain-sdk/models/api_declaration_document_request.rb +209 -0
  19. data/lib/tachain-sdk/models/api_declaration_list_dto.rb +251 -0
  20. data/lib/tachain-sdk/models/api_declaration_submit_request.rb +251 -0
  21. data/lib/tachain-sdk/models/api_declaration_submit_result_dto.rb +197 -0
  22. data/lib/tachain-sdk/models/api_integration_delete_request.rb +209 -0
  23. data/lib/tachain-sdk/models/api_order_confirm_receipt_request.rb +216 -0
  24. data/lib/tachain-sdk/models/api_order_submit_audit_request.rb +243 -0
  25. data/lib/tachain-sdk/models/api_response_api_declaration_list_dto.rb +199 -0
  26. data/lib/tachain-sdk/models/api_response_api_declaration_submit_result_dto.rb +199 -0
  27. data/lib/tachain-sdk/models/api_response_delivery_note_api_dto.rb +199 -0
  28. data/lib/tachain-sdk/models/api_response_order_api_dto.rb +199 -0
  29. data/lib/tachain-sdk/models/api_response_production_api_dto.rb +199 -0
  30. data/lib/tachain-sdk/models/api_response_string.rb +200 -0
  31. data/lib/tachain-sdk/models/attachment_in_api_create_dto.rb +262 -0
  32. data/lib/tachain-sdk/models/attachment_in_api_dto.rb +363 -0
  33. data/lib/tachain-sdk/models/brand_kpi_policy_result.rb +334 -0
  34. data/lib/tachain-sdk/models/brand_order_kpi_snapshot_dto.rb +880 -0
  35. data/lib/tachain-sdk/models/brand_order_supplier_order_snapshot_dto.rb +749 -0
  36. data/lib/tachain-sdk/models/brand_order_uncompleted_declare_snapshot_dto.rb +513 -0
  37. data/lib/tachain-sdk/models/company.rb +780 -0
  38. data/lib/tachain-sdk/models/company_compliance_profile.rb +547 -0
  39. data/lib/tachain-sdk/models/company_utility_declaration.rb +592 -0
  40. data/lib/tachain-sdk/models/customer.rb +569 -0
  41. data/lib/tachain-sdk/models/delivery_note_api_dto.rb +597 -0
  42. data/lib/tachain-sdk/models/delivery_note_detail_api_dto.rb +682 -0
  43. data/lib/tachain-sdk/models/document_type_api_dto.rb +480 -0
  44. data/lib/tachain-sdk/models/factory.rb +545 -0
  45. data/lib/tachain-sdk/models/get_v1_enum_get_list200_response.rb +201 -0
  46. data/lib/tachain-sdk/models/microsoft_asp_net_core_mvc_problem_details.rb +188 -0
  47. data/lib/tachain-sdk/models/model1.rb +157 -0
  48. data/lib/tachain-sdk/models/model3.rb +202 -0
  49. data/lib/tachain-sdk/models/model4.rb +202 -0
  50. data/lib/tachain-sdk/models/order.rb +974 -0
  51. data/lib/tachain-sdk/models/order_api_dto.rb +918 -0
  52. data/lib/tachain-sdk/models/order_line.rb +1184 -0
  53. data/lib/tachain-sdk/models/order_line_api_dto.rb +1277 -0
  54. data/lib/tachain-sdk/models/order_stage_form_api_dto.rb +270 -0
  55. data/lib/tachain-sdk/models/order_stage_form_datum_api_dto.rb +260 -0
  56. data/lib/tachain-sdk/models/order_stage_form_dto.rb +254 -0
  57. data/lib/tachain-sdk/models/paged_response_delivery_note_api_dto.rb +296 -0
  58. data/lib/tachain-sdk/models/paged_response_order_api_dto.rb +296 -0
  59. data/lib/tachain-sdk/models/paged_response_production_api_dto.rb +296 -0
  60. data/lib/tachain-sdk/models/product_bom_grouping_dto.rb +280 -0
  61. data/lib/tachain-sdk/models/production_api_dto.rb +639 -0
  62. data/lib/tachain-sdk/models/production_raw_material_api_dto.rb +481 -0
  63. data/lib/tachain-sdk/models/production_raw_material_dto.rb +548 -0
  64. data/lib/tachain-sdk/models/production_sales_order_api_dto.rb +436 -0
  65. data/lib/tachain-sdk/models/result_api_enum.rb +270 -0
  66. data/lib/tachain-sdk/models/result_brand_report_allocated_delivery_kpi_detail.rb +331 -0
  67. data/lib/tachain-sdk/models/result_brand_report_unlinked_order_detail.rb +229 -0
  68. data/lib/tachain-sdk/models/result_kpi_archived_data_change_detail.rb +418 -0
  69. data/lib/tachain-sdk/models/result_mapping_order_select.rb +335 -0
  70. data/lib/tachain-sdk/models/result_order_trace_report.rb +721 -0
  71. data/lib/tachain-sdk/models/stage_attachment_api_dto.rb +398 -0
  72. data/lib/tachain-sdk/models/supplier.rb +585 -0
  73. data/lib/tachain-sdk/models/supplier_onboarding_ext.rb +383 -0
  74. data/lib/tachain-sdk/models/template_dto_business_risk_warn_info_dto.rb +456 -0
  75. data/lib/tachain-sdk/models/template_dto_multi_so_line_complete_status.rb +227 -0
  76. data/lib/tachain-sdk/models/trader.rb +506 -0
  77. data/lib/tachain-sdk/signed_api_client.rb +65 -0
  78. data/lib/tachain-sdk/version.rb +15 -0
  79. data/lib/tachain-sdk.rb +108 -0
  80. data/spec/spec_helper.rb +111 -0
  81. data/tachain-sdk.gemspec +39 -0
  82. metadata +165 -0
@@ -0,0 +1,418 @@
1
+ =begin
2
+ #Tactic Chain Public API
3
+
4
+ #Public integration endpoints. Set your own base URL and credential before calling.
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.25.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module TachainSdk
17
+ # KPI 归档后影响完成判断的订单行变化明细;前端使用该对象列表做结构化展示,导出仍使用汇总文案字段。
18
+ class ResultKpiArchivedDataChangeDetail < ApiModelBase
19
+ # 变化类型编码:ModifiedLine 表示状态变化,AddedLine 表示归档后新增订单行,DeletedLine 表示归档后删除订单行。
20
+ attr_accessor :change_type
21
+
22
+ # 变化类型的多语言展示名称。
23
+ attr_accessor :change_type_name
24
+
25
+ # 发生变化的订单 ID;新增时取当前订单,删除时取归档供应商订单。
26
+ attr_accessor :order_id
27
+
28
+ # 发生变化的订单号;便于前端在详情里辅助定位订单。
29
+ attr_accessor :order_number
30
+
31
+ # 发生变化的订单明细 ID。
32
+ attr_accessor :order_line_id
33
+
34
+ # 发生变化的订单行序号。
35
+ attr_accessor :line_number
36
+
37
+ # 订单行对应的供应商公司 ID。
38
+ attr_accessor :supplier_id
39
+
40
+ # 订单行对应的供应商公司名称。
41
+ attr_accessor :supplier_name
42
+
43
+ # 订单行对应的客户公司 ID。
44
+ attr_accessor :customer_id
45
+
46
+ # 订单行对应的客户公司名称。
47
+ attr_accessor :customer_name
48
+
49
+ # 归档时按 MergeOrderLineDisplayStatus 合并后的采购订单状态值。
50
+ attr_accessor :archived_po_status_value
51
+
52
+ # 归档时采购订单状态的多语言展示名称。
53
+ attr_accessor :archived_po_status_name
54
+
55
+ # 当前按 MergeOrderLineDisplayStatus 合并后的采购订单状态值;删除订单行时为空。
56
+ attr_accessor :current_po_status_value
57
+
58
+ # 当前采购订单状态的多语言展示名称;删除订单行时展示已删除。
59
+ attr_accessor :current_po_status_name
60
+
61
+ # 归档时 order_chain_status,1 表示完成,0 表示未完成,空表示无归档值。
62
+ attr_accessor :archived_order_chain_status
63
+
64
+ # 当前 order_chain_status,1 表示完成,0 表示未完成,空表示当前无可比对值。
65
+ attr_accessor :current_order_chain_status
66
+
67
+ # 归档时 customer_confirm_status。
68
+ attr_accessor :archived_customer_confirm_status
69
+
70
+ # 当前 customer_confirm_status。
71
+ attr_accessor :current_customer_confirm_status
72
+
73
+ # order_chain_status 是否和归档值不一致。
74
+ attr_accessor :order_chain_status_changed
75
+
76
+ # customer_confirm_status 是否和归档值不一致。
77
+ attr_accessor :customer_confirm_status_changed
78
+
79
+ # 单条变化的多语言摘要;由品牌报表快照差异独立接口返回,导出不再输出详细摘要。
80
+ attr_accessor :summary
81
+
82
+ # Attribute mapping from ruby-style variable name to JSON key.
83
+ def self.attribute_map
84
+ {
85
+ :'change_type' => :'changeType',
86
+ :'change_type_name' => :'changeTypeName',
87
+ :'order_id' => :'orderId',
88
+ :'order_number' => :'orderNumber',
89
+ :'order_line_id' => :'orderLineId',
90
+ :'line_number' => :'lineNumber',
91
+ :'supplier_id' => :'supplierId',
92
+ :'supplier_name' => :'supplierName',
93
+ :'customer_id' => :'customerId',
94
+ :'customer_name' => :'customerName',
95
+ :'archived_po_status_value' => :'archivedPoStatusValue',
96
+ :'archived_po_status_name' => :'archivedPoStatusName',
97
+ :'current_po_status_value' => :'currentPoStatusValue',
98
+ :'current_po_status_name' => :'currentPoStatusName',
99
+ :'archived_order_chain_status' => :'archivedOrderChainStatus',
100
+ :'current_order_chain_status' => :'currentOrderChainStatus',
101
+ :'archived_customer_confirm_status' => :'archivedCustomerConfirmStatus',
102
+ :'current_customer_confirm_status' => :'currentCustomerConfirmStatus',
103
+ :'order_chain_status_changed' => :'orderChainStatusChanged',
104
+ :'customer_confirm_status_changed' => :'customerConfirmStatusChanged',
105
+ :'summary' => :'summary'
106
+ }
107
+ end
108
+
109
+ # Returns attribute mapping this model knows about
110
+ def self.acceptable_attribute_map
111
+ attribute_map
112
+ end
113
+
114
+ # Returns all the JSON keys this model knows about
115
+ def self.acceptable_attributes
116
+ acceptable_attribute_map.values
117
+ end
118
+
119
+ # Attribute type mapping.
120
+ def self.openapi_types
121
+ {
122
+ :'change_type' => :'String',
123
+ :'change_type_name' => :'String',
124
+ :'order_id' => :'String',
125
+ :'order_number' => :'String',
126
+ :'order_line_id' => :'String',
127
+ :'line_number' => :'String',
128
+ :'supplier_id' => :'String',
129
+ :'supplier_name' => :'String',
130
+ :'customer_id' => :'String',
131
+ :'customer_name' => :'String',
132
+ :'archived_po_status_value' => :'Integer',
133
+ :'archived_po_status_name' => :'String',
134
+ :'current_po_status_value' => :'Integer',
135
+ :'current_po_status_name' => :'String',
136
+ :'archived_order_chain_status' => :'Integer',
137
+ :'current_order_chain_status' => :'Integer',
138
+ :'archived_customer_confirm_status' => :'Integer',
139
+ :'current_customer_confirm_status' => :'Integer',
140
+ :'order_chain_status_changed' => :'Boolean',
141
+ :'customer_confirm_status_changed' => :'Boolean',
142
+ :'summary' => :'String'
143
+ }
144
+ end
145
+
146
+ # List of attributes with nullable: true
147
+ def self.openapi_nullable
148
+ Set.new([
149
+ :'change_type_name',
150
+ :'order_id',
151
+ :'order_number',
152
+ :'order_line_id',
153
+ :'line_number',
154
+ :'supplier_id',
155
+ :'supplier_name',
156
+ :'customer_id',
157
+ :'customer_name',
158
+ :'archived_po_status_value',
159
+ :'archived_po_status_name',
160
+ :'current_po_status_value',
161
+ :'current_po_status_name',
162
+ :'archived_order_chain_status',
163
+ :'current_order_chain_status',
164
+ :'archived_customer_confirm_status',
165
+ :'current_customer_confirm_status',
166
+ :'summary'
167
+ ])
168
+ end
169
+
170
+ # Initializes the object
171
+ # @param [Hash] attributes Model attributes in the form of hash
172
+ def initialize(attributes = {})
173
+ if (!attributes.is_a?(Hash))
174
+ fail ArgumentError, "The input argument (attributes) must be a hash in `TachainSdk::ResultKpiArchivedDataChangeDetail` initialize method"
175
+ end
176
+
177
+ # check to see if the attribute exists and convert string to symbol for hash key
178
+ acceptable_attribute_map = self.class.acceptable_attribute_map
179
+ attributes = attributes.each_with_object({}) { |(k, v), h|
180
+ if (!acceptable_attribute_map.key?(k.to_sym))
181
+ fail ArgumentError, "`#{k}` is not a valid attribute in `TachainSdk::ResultKpiArchivedDataChangeDetail`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
182
+ end
183
+ h[k.to_sym] = v
184
+ }
185
+
186
+ if attributes.key?(:'change_type')
187
+ self.change_type = attributes[:'change_type']
188
+ else
189
+ self.change_type = nil
190
+ end
191
+
192
+ if attributes.key?(:'change_type_name')
193
+ self.change_type_name = attributes[:'change_type_name']
194
+ end
195
+
196
+ if attributes.key?(:'order_id')
197
+ self.order_id = attributes[:'order_id']
198
+ end
199
+
200
+ if attributes.key?(:'order_number')
201
+ self.order_number = attributes[:'order_number']
202
+ end
203
+
204
+ if attributes.key?(:'order_line_id')
205
+ self.order_line_id = attributes[:'order_line_id']
206
+ end
207
+
208
+ if attributes.key?(:'line_number')
209
+ self.line_number = attributes[:'line_number']
210
+ end
211
+
212
+ if attributes.key?(:'supplier_id')
213
+ self.supplier_id = attributes[:'supplier_id']
214
+ end
215
+
216
+ if attributes.key?(:'supplier_name')
217
+ self.supplier_name = attributes[:'supplier_name']
218
+ end
219
+
220
+ if attributes.key?(:'customer_id')
221
+ self.customer_id = attributes[:'customer_id']
222
+ end
223
+
224
+ if attributes.key?(:'customer_name')
225
+ self.customer_name = attributes[:'customer_name']
226
+ end
227
+
228
+ if attributes.key?(:'archived_po_status_value')
229
+ self.archived_po_status_value = attributes[:'archived_po_status_value']
230
+ end
231
+
232
+ if attributes.key?(:'archived_po_status_name')
233
+ self.archived_po_status_name = attributes[:'archived_po_status_name']
234
+ end
235
+
236
+ if attributes.key?(:'current_po_status_value')
237
+ self.current_po_status_value = attributes[:'current_po_status_value']
238
+ end
239
+
240
+ if attributes.key?(:'current_po_status_name')
241
+ self.current_po_status_name = attributes[:'current_po_status_name']
242
+ end
243
+
244
+ if attributes.key?(:'archived_order_chain_status')
245
+ self.archived_order_chain_status = attributes[:'archived_order_chain_status']
246
+ end
247
+
248
+ if attributes.key?(:'current_order_chain_status')
249
+ self.current_order_chain_status = attributes[:'current_order_chain_status']
250
+ end
251
+
252
+ if attributes.key?(:'archived_customer_confirm_status')
253
+ self.archived_customer_confirm_status = attributes[:'archived_customer_confirm_status']
254
+ end
255
+
256
+ if attributes.key?(:'current_customer_confirm_status')
257
+ self.current_customer_confirm_status = attributes[:'current_customer_confirm_status']
258
+ end
259
+
260
+ if attributes.key?(:'order_chain_status_changed')
261
+ self.order_chain_status_changed = attributes[:'order_chain_status_changed']
262
+ else
263
+ self.order_chain_status_changed = nil
264
+ end
265
+
266
+ if attributes.key?(:'customer_confirm_status_changed')
267
+ self.customer_confirm_status_changed = attributes[:'customer_confirm_status_changed']
268
+ else
269
+ self.customer_confirm_status_changed = nil
270
+ end
271
+
272
+ if attributes.key?(:'summary')
273
+ self.summary = attributes[:'summary']
274
+ end
275
+ end
276
+
277
+ # Show invalid properties with the reasons. Usually used together with valid?
278
+ # @return Array for valid properties with the reasons
279
+ def list_invalid_properties
280
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
281
+ invalid_properties = Array.new
282
+ if @change_type.nil?
283
+ invalid_properties.push('invalid value for "change_type", change_type cannot be nil.')
284
+ end
285
+
286
+ if @order_chain_status_changed.nil?
287
+ invalid_properties.push('invalid value for "order_chain_status_changed", order_chain_status_changed cannot be nil.')
288
+ end
289
+
290
+ if @customer_confirm_status_changed.nil?
291
+ invalid_properties.push('invalid value for "customer_confirm_status_changed", customer_confirm_status_changed cannot be nil.')
292
+ end
293
+
294
+ invalid_properties
295
+ end
296
+
297
+ # Check to see if the all the properties in the model are valid
298
+ # @return true if the model is valid
299
+ def valid?
300
+ warn '[DEPRECATED] the `valid?` method is obsolete'
301
+ return false if @change_type.nil?
302
+ return false if @order_chain_status_changed.nil?
303
+ return false if @customer_confirm_status_changed.nil?
304
+ true
305
+ end
306
+
307
+ # Custom attribute writer method with validation
308
+ # @param [Object] change_type Value to be assigned
309
+ def change_type=(change_type)
310
+ if change_type.nil?
311
+ fail ArgumentError, 'change_type cannot be nil'
312
+ end
313
+
314
+ @change_type = change_type
315
+ end
316
+
317
+ # Custom attribute writer method with validation
318
+ # @param [Object] order_chain_status_changed Value to be assigned
319
+ def order_chain_status_changed=(order_chain_status_changed)
320
+ if order_chain_status_changed.nil?
321
+ fail ArgumentError, 'order_chain_status_changed cannot be nil'
322
+ end
323
+
324
+ @order_chain_status_changed = order_chain_status_changed
325
+ end
326
+
327
+ # Custom attribute writer method with validation
328
+ # @param [Object] customer_confirm_status_changed Value to be assigned
329
+ def customer_confirm_status_changed=(customer_confirm_status_changed)
330
+ if customer_confirm_status_changed.nil?
331
+ fail ArgumentError, 'customer_confirm_status_changed cannot be nil'
332
+ end
333
+
334
+ @customer_confirm_status_changed = customer_confirm_status_changed
335
+ end
336
+
337
+ # Checks equality by comparing each attribute.
338
+ # @param [Object] Object to be compared
339
+ def ==(o)
340
+ return true if self.equal?(o)
341
+ self.class == o.class &&
342
+ change_type == o.change_type &&
343
+ change_type_name == o.change_type_name &&
344
+ order_id == o.order_id &&
345
+ order_number == o.order_number &&
346
+ order_line_id == o.order_line_id &&
347
+ line_number == o.line_number &&
348
+ supplier_id == o.supplier_id &&
349
+ supplier_name == o.supplier_name &&
350
+ customer_id == o.customer_id &&
351
+ customer_name == o.customer_name &&
352
+ archived_po_status_value == o.archived_po_status_value &&
353
+ archived_po_status_name == o.archived_po_status_name &&
354
+ current_po_status_value == o.current_po_status_value &&
355
+ current_po_status_name == o.current_po_status_name &&
356
+ archived_order_chain_status == o.archived_order_chain_status &&
357
+ current_order_chain_status == o.current_order_chain_status &&
358
+ archived_customer_confirm_status == o.archived_customer_confirm_status &&
359
+ current_customer_confirm_status == o.current_customer_confirm_status &&
360
+ order_chain_status_changed == o.order_chain_status_changed &&
361
+ customer_confirm_status_changed == o.customer_confirm_status_changed &&
362
+ summary == o.summary
363
+ end
364
+
365
+ # @see the `==` method
366
+ # @param [Object] Object to be compared
367
+ def eql?(o)
368
+ self == o
369
+ end
370
+
371
+ # Calculates hash code according to all attributes.
372
+ # @return [Integer] Hash code
373
+ def hash
374
+ [change_type, change_type_name, order_id, order_number, order_line_id, line_number, supplier_id, supplier_name, customer_id, customer_name, archived_po_status_value, archived_po_status_name, current_po_status_value, current_po_status_name, archived_order_chain_status, current_order_chain_status, archived_customer_confirm_status, current_customer_confirm_status, order_chain_status_changed, customer_confirm_status_changed, summary].hash
375
+ end
376
+
377
+ # Builds the object from hash
378
+ # @param [Hash] attributes Model attributes in the form of hash
379
+ # @return [Object] Returns the model itself
380
+ def self.build_from_hash(attributes)
381
+ return nil unless attributes.is_a?(Hash)
382
+ attributes = attributes.transform_keys(&:to_sym)
383
+ transformed_hash = {}
384
+ openapi_types.each_pair do |key, type|
385
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
386
+ transformed_hash["#{key}"] = nil
387
+ elsif type =~ /\AArray<(.*)>/i
388
+ # check to ensure the input is an array given that the attribute
389
+ # is documented as an array but the input is not
390
+ if attributes[attribute_map[key]].is_a?(Array)
391
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
392
+ end
393
+ elsif !attributes[attribute_map[key]].nil?
394
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
395
+ end
396
+ end
397
+ new(transformed_hash)
398
+ end
399
+
400
+ # Returns the object in the form of hash
401
+ # @return [Hash] Returns the object in the form of hash
402
+ def to_hash
403
+ hash = {}
404
+ self.class.attribute_map.each_pair do |attr, param|
405
+ value = self.send(attr)
406
+ if value.nil?
407
+ is_nullable = self.class.openapi_nullable.include?(attr)
408
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
409
+ end
410
+
411
+ hash[param] = _to_hash(value)
412
+ end
413
+ hash
414
+ end
415
+
416
+ end
417
+
418
+ end