tachain-sdk 0.1.0 → 0.1.1

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 (160) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +148 -60
  3. data/lib/tachain-sdk/api/api_declaration_api.rb +155 -84
  4. data/lib/tachain-sdk/api/api_declaration_upload_api.rb +103 -0
  5. data/lib/tachain-sdk/api/api_delivery_api.rb +218 -138
  6. data/lib/tachain-sdk/api/api_enum_api.rb +2 -2
  7. data/lib/tachain-sdk/api/api_material_api.rb +414 -0
  8. data/lib/tachain-sdk/api/api_order_api.rb +185 -167
  9. data/lib/tachain-sdk/api/api_order_workflow_api.rb +227 -24
  10. data/lib/tachain-sdk/api/api_process_route_api.rb +414 -0
  11. data/lib/tachain-sdk/api/api_product_api.rb +414 -0
  12. data/lib/tachain-sdk/api/api_production_api.rb +141 -136
  13. data/lib/tachain-sdk/api/api_reference_api.rb +192 -0
  14. data/lib/tachain-sdk/models/{product_bom_grouping_dto.rb → api_bom_line_request.rb} +82 -107
  15. data/lib/tachain-sdk/models/api_bom_line_response.rb +205 -0
  16. data/lib/tachain-sdk/models/api_catalog_delete_request.rb +191 -0
  17. data/lib/tachain-sdk/models/{stage_attachment_api_dto.rb → api_declaration_attachment_response.rb} +16 -108
  18. data/lib/tachain-sdk/models/api_declaration_delete_request.rb +127 -17
  19. data/lib/tachain-sdk/models/api_declaration_document_request.rb +5 -27
  20. data/lib/tachain-sdk/models/api_declaration_file_request.rb +172 -0
  21. data/lib/tachain-sdk/models/api_declaration_form_request.rb +177 -0
  22. data/lib/tachain-sdk/models/{order_stage_form_datum_api_dto.rb → api_declaration_form_response.rb} +16 -49
  23. data/lib/tachain-sdk/models/api_declaration_list_response.rb +185 -0
  24. data/lib/tachain-sdk/models/api_declaration_submit_request.rb +171 -20
  25. data/lib/tachain-sdk/models/{api_declaration_submit_result_dto.rb → api_declaration_submit_response.rb} +10 -42
  26. data/lib/tachain-sdk/models/api_delivery_create_request.rb +292 -0
  27. data/lib/tachain-sdk/models/{result_brand_report_unlinked_order_detail.rb → api_delivery_delete_request.rb} +84 -60
  28. data/lib/tachain-sdk/models/api_delivery_detail_create_request.rb +353 -0
  29. data/lib/tachain-sdk/models/{delivery_note_detail_api_dto.rb → api_delivery_detail_response.rb} +23 -82
  30. data/lib/tachain-sdk/models/api_delivery_detail_update_request.rb +358 -0
  31. data/lib/tachain-sdk/models/{delivery_note_api_dto.rb → api_delivery_response.rb} +22 -192
  32. data/lib/tachain-sdk/models/api_delivery_update_request.rb +287 -0
  33. data/lib/tachain-sdk/models/{order_stage_form_dto.rb → api_document_form_response.rb} +16 -65
  34. data/lib/tachain-sdk/models/{document_type_api_dto.rb → api_document_type_response.rb} +30 -125
  35. data/lib/tachain-sdk/models/api_enum_value_response.rb +193 -0
  36. data/lib/tachain-sdk/models/{api_response_string.rb → api_error_response.rb} +22 -34
  37. data/lib/tachain-sdk/models/api_fiber_composition_request.rb +193 -0
  38. data/lib/tachain-sdk/models/api_fiber_composition_response.rb +160 -0
  39. data/lib/tachain-sdk/models/{attachment_in_api_dto.rb → api_file_response.rb} +23 -115
  40. data/lib/tachain-sdk/models/api_file_upload_response.rb +150 -0
  41. data/lib/tachain-sdk/models/api_mapping_response.rb +182 -0
  42. data/lib/tachain-sdk/models/api_material_create_request.rb +556 -0
  43. data/lib/tachain-sdk/models/api_material_response.rb +349 -0
  44. data/lib/tachain-sdk/models/api_material_update_request.rb +582 -0
  45. data/lib/tachain-sdk/models/{result_mapping_order_select.rb → api_order_accept_request.rb} +105 -70
  46. data/lib/tachain-sdk/models/api_order_confirm_receipt_request.rb +106 -29
  47. data/lib/tachain-sdk/models/api_order_create_request.rb +379 -0
  48. data/lib/tachain-sdk/models/api_order_declaration_verification_request.rb +293 -0
  49. data/lib/tachain-sdk/models/api_order_declaration_verification_response.rb +203 -0
  50. data/lib/tachain-sdk/models/api_order_delete_line_request.rb +315 -0
  51. data/lib/tachain-sdk/models/api_order_delete_request.rb +315 -0
  52. data/lib/tachain-sdk/models/api_order_line_create_request.rb +445 -0
  53. data/lib/tachain-sdk/models/{order_line_api_dto.rb → api_order_line_response.rb} +39 -330
  54. data/lib/tachain-sdk/models/api_order_line_update_request.rb +416 -0
  55. data/lib/tachain-sdk/models/api_order_receipt_pending_line_response.rb +171 -0
  56. data/lib/tachain-sdk/models/{microsoft_asp_net_core_mvc_problem_details.rb → api_order_receipt_pending_response.rb} +28 -45
  57. data/lib/tachain-sdk/models/api_order_receipt_result.rb +185 -0
  58. data/lib/tachain-sdk/models/{order_api_dto.rb → api_order_response.rb} +35 -291
  59. data/lib/tachain-sdk/models/api_order_submit_audit_request.rb +102 -42
  60. data/lib/tachain-sdk/models/api_order_submit_audit_response.rb +196 -0
  61. data/lib/tachain-sdk/models/api_order_update_request.rb +408 -0
  62. data/lib/tachain-sdk/models/api_page_result1_api_delivery_response.rb +220 -0
  63. data/lib/tachain-sdk/models/api_page_result1_api_material_response.rb +220 -0
  64. data/lib/tachain-sdk/models/api_page_result1_api_order_response.rb +220 -0
  65. data/lib/tachain-sdk/models/api_page_result1_api_process_route_response.rb +220 -0
  66. data/lib/tachain-sdk/models/{api_response_api_declaration_list_dto.rb → api_page_result1_api_product_response.rb} +48 -27
  67. data/lib/tachain-sdk/models/api_page_result1_api_production_response.rb +220 -0
  68. data/lib/tachain-sdk/models/{result_api_enum.rb → api_process_route_create_request.rb} +88 -62
  69. data/lib/tachain-sdk/models/api_process_route_response.rb +237 -0
  70. data/lib/tachain-sdk/models/{paged_response_delivery_note_api_dto.rb → api_process_route_update_request.rb} +102 -91
  71. data/lib/tachain-sdk/models/api_process_step_request.rb +201 -0
  72. data/lib/tachain-sdk/models/api_process_step_response.rb +171 -0
  73. data/lib/tachain-sdk/models/api_product_create_request.rb +595 -0
  74. data/lib/tachain-sdk/models/api_product_response.rb +373 -0
  75. data/lib/tachain-sdk/models/api_product_update_request.rb +621 -0
  76. data/lib/tachain-sdk/models/api_production_create_request.rb +381 -0
  77. data/lib/tachain-sdk/models/{api_integration_delete_request.rb → api_production_delete_request.rb} +22 -11
  78. data/lib/tachain-sdk/models/api_production_raw_material_create_request.rb +320 -0
  79. data/lib/tachain-sdk/models/{production_raw_material_api_dto.rb → api_production_raw_material_response.rb} +18 -118
  80. data/lib/tachain-sdk/models/api_production_raw_material_update_request.rb +325 -0
  81. data/lib/tachain-sdk/models/{production_api_dto.rb → api_production_response.rb} +23 -156
  82. data/lib/tachain-sdk/models/api_production_sales_order_create_request.rb +309 -0
  83. data/lib/tachain-sdk/models/{production_sales_order_api_dto.rb → api_production_sales_order_response.rb} +17 -94
  84. data/lib/tachain-sdk/models/api_production_sales_order_update_request.rb +314 -0
  85. data/lib/tachain-sdk/models/api_production_update_request.rb +392 -0
  86. data/lib/tachain-sdk/models/api_receipt_pending_item_response.rb +207 -0
  87. data/lib/tachain-sdk/models/api_reference_page_response1_api_enum_value_response.rb +162 -0
  88. data/lib/tachain-sdk/models/api_reference_page_response1_api_mapping_response.rb +162 -0
  89. data/lib/tachain-sdk/models/{api_response_production_api_dto.rb → api_result1_api_declaration_list_response.rb} +20 -33
  90. data/lib/tachain-sdk/models/api_result1_api_declaration_submit_response.rb +186 -0
  91. data/lib/tachain-sdk/models/{api_response_delivery_note_api_dto.rb → api_result1_api_delivery_response.rb} +20 -33
  92. data/lib/tachain-sdk/models/api_result1_api_file_upload_response.rb +186 -0
  93. data/lib/tachain-sdk/models/api_result1_api_material_response.rb +186 -0
  94. data/lib/tachain-sdk/models/api_result1_api_order_declaration_verification_response.rb +186 -0
  95. data/lib/tachain-sdk/models/{api_response_api_declaration_submit_result_dto.rb → api_result1_api_order_receipt_pending_response.rb} +20 -33
  96. data/lib/tachain-sdk/models/api_result1_api_order_receipt_result.rb +186 -0
  97. data/lib/tachain-sdk/models/api_result1_api_order_response.rb +186 -0
  98. data/lib/tachain-sdk/models/api_result1_api_order_submit_audit_response.rb +186 -0
  99. data/lib/tachain-sdk/models/api_result1_api_process_route_response.rb +186 -0
  100. data/lib/tachain-sdk/models/api_result1_api_product_response.rb +186 -0
  101. data/lib/tachain-sdk/models/api_result1_api_production_response.rb +186 -0
  102. data/lib/tachain-sdk/models/{api_response_order_api_dto.rb → api_result1_string.rb} +22 -33
  103. data/lib/tachain-sdk/models/{attachment_in_api_create_dto.rb → api_verification_file_response.rb} +106 -84
  104. data/lib/tachain-sdk/models/api_verification_response.rb +218 -0
  105. data/lib/tachain-sdk/models/delete_v1_declaration_delete200_response.rb +103 -0
  106. data/lib/tachain-sdk/models/get_v1_declaration_list_paging200_response.rb +103 -0
  107. data/lib/tachain-sdk/models/get_v1_declaration_required_documents200_response.rb +103 -0
  108. data/lib/tachain-sdk/models/get_v1_delivery_list_paging200_response.rb +103 -0
  109. data/lib/tachain-sdk/models/get_v1_enum_get_list200_response.rb +73 -171
  110. data/lib/tachain-sdk/models/get_v1_material_list_paging200_response.rb +103 -0
  111. data/lib/tachain-sdk/models/get_v1_order_po_list_paging200_response.rb +103 -0
  112. data/lib/tachain-sdk/models/get_v1_order_receipt_pending200_response.rb +103 -0
  113. data/lib/tachain-sdk/models/get_v1_process_route_list_paging200_response.rb +103 -0
  114. data/lib/tachain-sdk/models/get_v1_product_list_paging200_response.rb +103 -0
  115. data/lib/tachain-sdk/models/get_v1_production_list_paging200_response.rb +103 -0
  116. data/lib/tachain-sdk/models/get_v1_reference_enum_values200_response.rb +103 -0
  117. data/lib/tachain-sdk/models/get_v1_reference_mappings200_response.rb +103 -0
  118. data/lib/tachain-sdk/models/model1.rb +47 -14
  119. data/lib/tachain-sdk/models/model2.rb +190 -0
  120. data/lib/tachain-sdk/models/model3.rb +17 -33
  121. data/lib/tachain-sdk/models/model4.rb +17 -33
  122. data/lib/tachain-sdk/models/post_v1_declaration_submit200_response.rb +103 -0
  123. data/lib/tachain-sdk/models/post_v1_declaration_upload_file200_response.rb +103 -0
  124. data/lib/tachain-sdk/models/post_v1_material_create200_response.rb +103 -0
  125. data/lib/tachain-sdk/models/post_v1_order_create200_response.rb +103 -0
  126. data/lib/tachain-sdk/models/post_v1_order_declaration_verification200_response.rb +103 -0
  127. data/lib/tachain-sdk/models/post_v1_order_submit_audit200_response.rb +103 -0
  128. data/lib/tachain-sdk/models/post_v1_process_route_create200_response.rb +103 -0
  129. data/lib/tachain-sdk/models/post_v1_product_create200_response.rb +103 -0
  130. data/lib/tachain-sdk/models/post_v1_production_create200_response.rb +103 -0
  131. data/lib/tachain-sdk/models/put_v1_delivery_confirm_receipt200_response.rb +103 -0
  132. data/lib/tachain-sdk/models/put_v1_delivery_return_receipt200_response.rb +103 -0
  133. data/lib/tachain-sdk/models/put_v1_order_confirm_receipt200_response.rb +103 -0
  134. data/lib/tachain-sdk/version.rb +1 -1
  135. data/lib/tachain-sdk.rb +116 -51
  136. metadata +118 -53
  137. data/lib/tachain-sdk/models/api_declaration_list_dto.rb +0 -251
  138. data/lib/tachain-sdk/models/brand_kpi_policy_result.rb +0 -334
  139. data/lib/tachain-sdk/models/brand_order_kpi_snapshot_dto.rb +0 -880
  140. data/lib/tachain-sdk/models/brand_order_supplier_order_snapshot_dto.rb +0 -749
  141. data/lib/tachain-sdk/models/brand_order_uncompleted_declare_snapshot_dto.rb +0 -513
  142. data/lib/tachain-sdk/models/company.rb +0 -780
  143. data/lib/tachain-sdk/models/company_compliance_profile.rb +0 -547
  144. data/lib/tachain-sdk/models/company_utility_declaration.rb +0 -592
  145. data/lib/tachain-sdk/models/customer.rb +0 -569
  146. data/lib/tachain-sdk/models/factory.rb +0 -545
  147. data/lib/tachain-sdk/models/order.rb +0 -974
  148. data/lib/tachain-sdk/models/order_line.rb +0 -1184
  149. data/lib/tachain-sdk/models/order_stage_form_api_dto.rb +0 -270
  150. data/lib/tachain-sdk/models/paged_response_order_api_dto.rb +0 -296
  151. data/lib/tachain-sdk/models/paged_response_production_api_dto.rb +0 -296
  152. data/lib/tachain-sdk/models/production_raw_material_dto.rb +0 -548
  153. data/lib/tachain-sdk/models/result_brand_report_allocated_delivery_kpi_detail.rb +0 -331
  154. data/lib/tachain-sdk/models/result_kpi_archived_data_change_detail.rb +0 -418
  155. data/lib/tachain-sdk/models/result_order_trace_report.rb +0 -721
  156. data/lib/tachain-sdk/models/supplier.rb +0 -585
  157. data/lib/tachain-sdk/models/supplier_onboarding_ext.rb +0 -383
  158. data/lib/tachain-sdk/models/template_dto_business_risk_warn_info_dto.rb +0 -456
  159. data/lib/tachain-sdk/models/template_dto_multi_so_line_complete_status.rb +0 -227
  160. data/lib/tachain-sdk/models/trader.rb +0 -506
@@ -0,0 +1,381 @@
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
+ # 新增专用集成请求;只接收本操作使用的业务字段。
18
+ class ApiProductionCreateRequest < ApiModelBase
19
+ # 生产编号(MTO)
20
+ attr_accessor :number
21
+
22
+ # 生产开始日期(MTO)
23
+ attr_accessor :production_date
24
+
25
+ # 生产结束日期(MTO)
26
+ attr_accessor :production_end_date
27
+
28
+ # 成品编码(MTO)
29
+ attr_accessor :product_code
30
+
31
+ # 生产数量\\入库数量
32
+ attr_accessor :quantity_produced
33
+
34
+ # 生产工厂编码。外部不知道 FacilityId 时,可传枚举接口 Factory.Code/Name/ShortName,由接口解析内部工厂公司 ID。
35
+ attr_accessor :facility_code
36
+
37
+ # 工艺路线编码。外部不知道 ProcessRouteId 时,可传枚举接口 ProcessRoute.Code/Name,由接口解析内部工艺路线 ID。
38
+ attr_accessor :process_route_code
39
+
40
+ # 批次描述(MTO)
41
+ attr_accessor :batch
42
+
43
+ # 生成类型(0 MTO, 1 MTS)
44
+ attr_accessor :type
45
+
46
+ # 生产使用的bom版本 条件:启用 BOM 强制校验的成品需选择有效 BOM 版本;未启用时可省略。
47
+ attr_accessor :use_bom_batch
48
+
49
+ # 成品入库单编号(MTS) 条件:Type=1(MTS)时必填。
50
+ attr_accessor :receipt_number
51
+
52
+ # 入库日期(开始)(MTS) 条件:Type=1 时填写入库开始日期。
53
+ attr_accessor :receipt_date
54
+
55
+ # 入库结束日期(MTS)
56
+ attr_accessor :receipt_end_date
57
+
58
+ # ProductionRawMaterialList 业务明细。
59
+ attr_accessor :production_raw_material_list
60
+
61
+ # ProductionSalesOrderList 业务明细。
62
+ attr_accessor :production_sales_order_list
63
+
64
+ # Attribute mapping from ruby-style variable name to JSON key.
65
+ def self.attribute_map
66
+ {
67
+ :'number' => :'number',
68
+ :'production_date' => :'productionDate',
69
+ :'production_end_date' => :'productionEndDate',
70
+ :'product_code' => :'productCode',
71
+ :'quantity_produced' => :'quantityProduced',
72
+ :'facility_code' => :'facilityCode',
73
+ :'process_route_code' => :'processRouteCode',
74
+ :'batch' => :'batch',
75
+ :'type' => :'type',
76
+ :'use_bom_batch' => :'useBomBatch',
77
+ :'receipt_number' => :'receiptNumber',
78
+ :'receipt_date' => :'receiptDate',
79
+ :'receipt_end_date' => :'receiptEndDate',
80
+ :'production_raw_material_list' => :'productionRawMaterialList',
81
+ :'production_sales_order_list' => :'productionSalesOrderList'
82
+ }
83
+ end
84
+
85
+ # Returns attribute mapping this model knows about
86
+ def self.acceptable_attribute_map
87
+ attribute_map
88
+ end
89
+
90
+ # Returns all the JSON keys this model knows about
91
+ def self.acceptable_attributes
92
+ acceptable_attribute_map.values
93
+ end
94
+
95
+ # Attribute type mapping.
96
+ def self.openapi_types
97
+ {
98
+ :'number' => :'String',
99
+ :'production_date' => :'Time',
100
+ :'production_end_date' => :'Time',
101
+ :'product_code' => :'String',
102
+ :'quantity_produced' => :'Float',
103
+ :'facility_code' => :'String',
104
+ :'process_route_code' => :'String',
105
+ :'batch' => :'String',
106
+ :'type' => :'Integer',
107
+ :'use_bom_batch' => :'String',
108
+ :'receipt_number' => :'String',
109
+ :'receipt_date' => :'Time',
110
+ :'receipt_end_date' => :'Time',
111
+ :'production_raw_material_list' => :'Array<ApiProductionRawMaterialCreateRequest>',
112
+ :'production_sales_order_list' => :'Array<ApiProductionSalesOrderCreateRequest>'
113
+ }
114
+ end
115
+
116
+ # List of attributes with nullable: true
117
+ def self.openapi_nullable
118
+ Set.new([
119
+ :'production_date',
120
+ :'production_end_date',
121
+ :'facility_code',
122
+ :'process_route_code',
123
+ :'batch',
124
+ :'type',
125
+ :'use_bom_batch',
126
+ :'receipt_number',
127
+ :'receipt_date',
128
+ :'receipt_end_date',
129
+ :'production_sales_order_list'
130
+ ])
131
+ end
132
+
133
+ # Initializes the object
134
+ # @param [Hash] attributes Model attributes in the form of hash
135
+ def initialize(attributes = {})
136
+ if (!attributes.is_a?(Hash))
137
+ fail ArgumentError, "The input argument (attributes) must be a hash in `TachainSdk::ApiProductionCreateRequest` initialize method"
138
+ end
139
+
140
+ # check to see if the attribute exists and convert string to symbol for hash key
141
+ acceptable_attribute_map = self.class.acceptable_attribute_map
142
+ attributes = attributes.each_with_object({}) { |(k, v), h|
143
+ if (!acceptable_attribute_map.key?(k.to_sym))
144
+ fail ArgumentError, "`#{k}` is not a valid attribute in `TachainSdk::ApiProductionCreateRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
145
+ end
146
+ h[k.to_sym] = v
147
+ }
148
+
149
+ if attributes.key?(:'number')
150
+ self.number = attributes[:'number']
151
+ else
152
+ self.number = nil
153
+ end
154
+
155
+ if attributes.key?(:'production_date')
156
+ self.production_date = attributes[:'production_date']
157
+ end
158
+
159
+ if attributes.key?(:'production_end_date')
160
+ self.production_end_date = attributes[:'production_end_date']
161
+ end
162
+
163
+ if attributes.key?(:'product_code')
164
+ self.product_code = attributes[:'product_code']
165
+ else
166
+ self.product_code = nil
167
+ end
168
+
169
+ if attributes.key?(:'quantity_produced')
170
+ self.quantity_produced = attributes[:'quantity_produced']
171
+ else
172
+ self.quantity_produced = nil
173
+ end
174
+
175
+ if attributes.key?(:'facility_code')
176
+ self.facility_code = attributes[:'facility_code']
177
+ end
178
+
179
+ if attributes.key?(:'process_route_code')
180
+ self.process_route_code = attributes[:'process_route_code']
181
+ end
182
+
183
+ if attributes.key?(:'batch')
184
+ self.batch = attributes[:'batch']
185
+ end
186
+
187
+ if attributes.key?(:'type')
188
+ self.type = attributes[:'type']
189
+ end
190
+
191
+ if attributes.key?(:'use_bom_batch')
192
+ self.use_bom_batch = attributes[:'use_bom_batch']
193
+ end
194
+
195
+ if attributes.key?(:'receipt_number')
196
+ self.receipt_number = attributes[:'receipt_number']
197
+ end
198
+
199
+ if attributes.key?(:'receipt_date')
200
+ self.receipt_date = attributes[:'receipt_date']
201
+ end
202
+
203
+ if attributes.key?(:'receipt_end_date')
204
+ self.receipt_end_date = attributes[:'receipt_end_date']
205
+ end
206
+
207
+ if attributes.key?(:'production_raw_material_list')
208
+ if (value = attributes[:'production_raw_material_list']).is_a?(Array)
209
+ self.production_raw_material_list = value
210
+ end
211
+ else
212
+ self.production_raw_material_list = nil
213
+ end
214
+
215
+ if attributes.key?(:'production_sales_order_list')
216
+ if (value = attributes[:'production_sales_order_list']).is_a?(Array)
217
+ self.production_sales_order_list = value
218
+ end
219
+ end
220
+ end
221
+
222
+ # Show invalid properties with the reasons. Usually used together with valid?
223
+ # @return Array for valid properties with the reasons
224
+ def list_invalid_properties
225
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
226
+ invalid_properties = Array.new
227
+ if @number.nil?
228
+ invalid_properties.push('invalid value for "number", number cannot be nil.')
229
+ end
230
+
231
+ if @product_code.nil?
232
+ invalid_properties.push('invalid value for "product_code", product_code cannot be nil.')
233
+ end
234
+
235
+ if @quantity_produced.nil?
236
+ invalid_properties.push('invalid value for "quantity_produced", quantity_produced cannot be nil.')
237
+ end
238
+
239
+ if @production_raw_material_list.nil?
240
+ invalid_properties.push('invalid value for "production_raw_material_list", production_raw_material_list cannot be nil.')
241
+ end
242
+
243
+ if @production_raw_material_list.length < 1
244
+ invalid_properties.push('invalid value for "production_raw_material_list", number of items must be greater than or equal to 1.')
245
+ end
246
+
247
+ invalid_properties
248
+ end
249
+
250
+ # Check to see if the all the properties in the model are valid
251
+ # @return true if the model is valid
252
+ def valid?
253
+ warn '[DEPRECATED] the `valid?` method is obsolete'
254
+ return false if @number.nil?
255
+ return false if @product_code.nil?
256
+ return false if @quantity_produced.nil?
257
+ return false if @production_raw_material_list.nil?
258
+ return false if @production_raw_material_list.length < 1
259
+ true
260
+ end
261
+
262
+ # Custom attribute writer method with validation
263
+ # @param [Object] number Value to be assigned
264
+ def number=(number)
265
+ if number.nil?
266
+ fail ArgumentError, 'number cannot be nil'
267
+ end
268
+
269
+ @number = number
270
+ end
271
+
272
+ # Custom attribute writer method with validation
273
+ # @param [Object] product_code Value to be assigned
274
+ def product_code=(product_code)
275
+ if product_code.nil?
276
+ fail ArgumentError, 'product_code cannot be nil'
277
+ end
278
+
279
+ @product_code = product_code
280
+ end
281
+
282
+ # Custom attribute writer method with validation
283
+ # @param [Object] quantity_produced Value to be assigned
284
+ def quantity_produced=(quantity_produced)
285
+ if quantity_produced.nil?
286
+ fail ArgumentError, 'quantity_produced cannot be nil'
287
+ end
288
+
289
+ @quantity_produced = quantity_produced
290
+ end
291
+
292
+ # Custom attribute writer method with validation
293
+ # @param [Object] production_raw_material_list Value to be assigned
294
+ def production_raw_material_list=(production_raw_material_list)
295
+ if production_raw_material_list.nil?
296
+ fail ArgumentError, 'production_raw_material_list cannot be nil'
297
+ end
298
+
299
+ if production_raw_material_list.length < 1
300
+ fail ArgumentError, 'invalid value for "production_raw_material_list", number of items must be greater than or equal to 1.'
301
+ end
302
+
303
+ @production_raw_material_list = production_raw_material_list
304
+ end
305
+
306
+ # Checks equality by comparing each attribute.
307
+ # @param [Object] Object to be compared
308
+ def ==(o)
309
+ return true if self.equal?(o)
310
+ self.class == o.class &&
311
+ number == o.number &&
312
+ production_date == o.production_date &&
313
+ production_end_date == o.production_end_date &&
314
+ product_code == o.product_code &&
315
+ quantity_produced == o.quantity_produced &&
316
+ facility_code == o.facility_code &&
317
+ process_route_code == o.process_route_code &&
318
+ batch == o.batch &&
319
+ type == o.type &&
320
+ use_bom_batch == o.use_bom_batch &&
321
+ receipt_number == o.receipt_number &&
322
+ receipt_date == o.receipt_date &&
323
+ receipt_end_date == o.receipt_end_date &&
324
+ production_raw_material_list == o.production_raw_material_list &&
325
+ production_sales_order_list == o.production_sales_order_list
326
+ end
327
+
328
+ # @see the `==` method
329
+ # @param [Object] Object to be compared
330
+ def eql?(o)
331
+ self == o
332
+ end
333
+
334
+ # Calculates hash code according to all attributes.
335
+ # @return [Integer] Hash code
336
+ def hash
337
+ [number, production_date, production_end_date, product_code, quantity_produced, facility_code, process_route_code, batch, type, use_bom_batch, receipt_number, receipt_date, receipt_end_date, production_raw_material_list, production_sales_order_list].hash
338
+ end
339
+
340
+ # Builds the object from hash
341
+ # @param [Hash] attributes Model attributes in the form of hash
342
+ # @return [Object] Returns the model itself
343
+ def self.build_from_hash(attributes)
344
+ return nil unless attributes.is_a?(Hash)
345
+ attributes = attributes.transform_keys(&:to_sym)
346
+ transformed_hash = {}
347
+ openapi_types.each_pair do |key, type|
348
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
349
+ transformed_hash["#{key}"] = nil
350
+ elsif type =~ /\AArray<(.*)>/i
351
+ # check to ensure the input is an array given that the attribute
352
+ # is documented as an array but the input is not
353
+ if attributes[attribute_map[key]].is_a?(Array)
354
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
355
+ end
356
+ elsif !attributes[attribute_map[key]].nil?
357
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
358
+ end
359
+ end
360
+ new(transformed_hash)
361
+ end
362
+
363
+ # Returns the object in the form of hash
364
+ # @return [Hash] Returns the object in the form of hash
365
+ def to_hash
366
+ hash = {}
367
+ self.class.attribute_map.each_pair do |attr, param|
368
+ value = self.send(attr)
369
+ if value.nil?
370
+ is_nullable = self.class.openapi_nullable.include?(attr)
371
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
372
+ end
373
+
374
+ hash[param] = _to_hash(value)
375
+ end
376
+ hash
377
+ end
378
+
379
+ end
380
+
381
+ end
@@ -14,8 +14,8 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module TachainSdk
17
- # 通用删除请求。
18
- class ApiIntegrationDeleteRequest < ApiModelBase
17
+ # 生产单删除:Id/Ids 或 Number/Numbers + ProductCode;Type 可选校验。
18
+ class ApiProductionDeleteRequest < ApiModelBase
19
19
  # 单个业务 ID。
20
20
  attr_accessor :id
21
21
 
@@ -28,12 +28,15 @@ module TachainSdk
28
28
  # 批量业务单号。
29
29
  attr_accessor :numbers
30
30
 
31
- # 产品编码。删除生产单按 Number 定位时,需要配合 Type 保证生产单唯一。
31
+ # 成品编码、名称或外部映射。生产单在当前公司按 Number + ProductCode 唯一定位。
32
32
  attr_accessor :product_code
33
33
 
34
- # 生产类型。生产单按 Number + ProductCode 删除时参与唯一性定位。
34
+ # 生产类型,可选条件校验;不是生产单唯一键的组成部分。
35
35
  attr_accessor :type
36
36
 
37
+ # 入库单号,可选,生产单删除时参与交叉校验。
38
+ attr_accessor :receipt_number
39
+
37
40
  # Attribute mapping from ruby-style variable name to JSON key.
38
41
  def self.attribute_map
39
42
  {
@@ -42,7 +45,8 @@ module TachainSdk
42
45
  :'number' => :'number',
43
46
  :'numbers' => :'numbers',
44
47
  :'product_code' => :'productCode',
45
- :'type' => :'type'
48
+ :'type' => :'type',
49
+ :'receipt_number' => :'receiptNumber'
46
50
  }
47
51
  end
48
52
 
@@ -64,7 +68,8 @@ module TachainSdk
64
68
  :'number' => :'String',
65
69
  :'numbers' => :'Array<String>',
66
70
  :'product_code' => :'String',
67
- :'type' => :'Integer'
71
+ :'type' => :'Integer',
72
+ :'receipt_number' => :'String'
68
73
  }
69
74
  end
70
75
 
@@ -76,7 +81,8 @@ module TachainSdk
76
81
  :'number',
77
82
  :'numbers',
78
83
  :'product_code',
79
- :'type'
84
+ :'type',
85
+ :'receipt_number'
80
86
  ])
81
87
  end
82
88
 
@@ -84,14 +90,14 @@ module TachainSdk
84
90
  # @param [Hash] attributes Model attributes in the form of hash
85
91
  def initialize(attributes = {})
86
92
  if (!attributes.is_a?(Hash))
87
- fail ArgumentError, "The input argument (attributes) must be a hash in `TachainSdk::ApiIntegrationDeleteRequest` initialize method"
93
+ fail ArgumentError, "The input argument (attributes) must be a hash in `TachainSdk::ApiProductionDeleteRequest` initialize method"
88
94
  end
89
95
 
90
96
  # check to see if the attribute exists and convert string to symbol for hash key
91
97
  acceptable_attribute_map = self.class.acceptable_attribute_map
92
98
  attributes = attributes.each_with_object({}) { |(k, v), h|
93
99
  if (!acceptable_attribute_map.key?(k.to_sym))
94
- fail ArgumentError, "`#{k}` is not a valid attribute in `TachainSdk::ApiIntegrationDeleteRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
100
+ fail ArgumentError, "`#{k}` is not a valid attribute in `TachainSdk::ApiProductionDeleteRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
95
101
  end
96
102
  h[k.to_sym] = v
97
103
  }
@@ -123,6 +129,10 @@ module TachainSdk
123
129
  if attributes.key?(:'type')
124
130
  self.type = attributes[:'type']
125
131
  end
132
+
133
+ if attributes.key?(:'receipt_number')
134
+ self.receipt_number = attributes[:'receipt_number']
135
+ end
126
136
  end
127
137
 
128
138
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -150,7 +160,8 @@ module TachainSdk
150
160
  number == o.number &&
151
161
  numbers == o.numbers &&
152
162
  product_code == o.product_code &&
153
- type == o.type
163
+ type == o.type &&
164
+ receipt_number == o.receipt_number
154
165
  end
155
166
 
156
167
  # @see the `==` method
@@ -162,7 +173,7 @@ module TachainSdk
162
173
  # Calculates hash code according to all attributes.
163
174
  # @return [Integer] Hash code
164
175
  def hash
165
- [id, ids, number, numbers, product_code, type].hash
176
+ [id, ids, number, numbers, product_code, type, receipt_number].hash
166
177
  end
167
178
 
168
179
  # Builds the object from hash