erp_integration 0.34.0 → 0.36.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 46c2613fa4d588241f06f9a130cdc5fece97ba69c5e732d66d4ff141adabb080
4
- data.tar.gz: 71e0908f8b3fbfcf89a28d15445cd8d3b170a19ba81182c0af03be0933a64631
3
+ metadata.gz: 60981ef82d7fc4ee99a747def31bb01d5bac2c6596e258e1025f11a52b60be09
4
+ data.tar.gz: 2bd4161b4acd66ef8878d4736a0909948e22b066c93de4c218a7f49246c887d4
5
5
  SHA512:
6
- metadata.gz: 273b05cc0dbf4030cb6a0a39788614165aba29392795e196228987300a74043a81760ded720d8ba548f0c74708293bb0e845add3b4f3ecef7d69e3939fb5a558
7
- data.tar.gz: 0e8969487347f3a661ffaa5c789b65fae4da98f1c2e117f19aef0286e86a8856b70f70e71b095c48d5698f39112fea808ef28620935308f268fb74574b211a69
6
+ metadata.gz: b9f9d08096d1856a28b219d80a375a67d1e6b442785e531ee40e79148af2ea95d4cba9af23d4a20d9b6c15c6a818707cb7b2a3790140e57dfa1e9a4ba878a760
7
+ data.tar.gz: a48d617a9e48b83d015ce237e6c5a4e11cbfd0b132f0eb76a557a3c8cb9b42c6608ff1fff0ce253a766796be1451b59e2a9e864d3d29b4fa8230ecf568a28953
data/.rubocop.yml CHANGED
@@ -82,6 +82,8 @@ Naming/PredicateName:
82
82
  Enabled: true
83
83
 
84
84
  Metrics/ClassLength:
85
+ Exclude:
86
+ - lib/erp_integration/configuration.rb
85
87
  Enabled: true
86
88
 
87
89
  Style/AndOr:
@@ -57,6 +57,16 @@ module ErpIntegration
57
57
  # @return [Symbol] The configured adapter for the products.
58
58
  attr_writer :product_adapter
59
59
 
60
+ # Allows configuring an adapter for the `ProductCategory` resource. When none is
61
+ # configured, it will default to Fulfil.
62
+ # @return [Symbol] The configured adapter for the product category.
63
+ attr_writer :product_category_adapter
64
+
65
+ # Allows configuring an adapter for the `ProductTemplate` resource. When none is
66
+ # configured, it will default to Fulfil.
67
+ # @return [Symbol] The configured adapter for the product templates.
68
+ attr_writer :product_template_adapter
69
+
60
70
  # Allows configuring an adapter for the `ProductionOrder` resource. When
61
71
  # none is configured, it will default to Fulfil.
62
72
  # @return [Symbol] The configured adapter for the production_order.
@@ -97,6 +107,11 @@ module ErpIntegration
97
107
  # @return [Symbol] The configured adapter for the supplier shipment.
98
108
  attr_writer :supplier_shipment_adapter
99
109
 
110
+ # Allows configuring an adapter for the `StockBinTransfer` resource. When
111
+ # none is configured, it will default to Fulfil.
112
+ # @return [Symbol] The configured adapter for the stock bin transfer.
113
+ attr_writer :stock_bin_transfer_adapter
114
+
100
115
  # Allows configuring an adapter for the `StockMove` resource. When
101
116
  # none is configured, it will default to Fulfil.
102
117
  # @return [Symbol] The configured adapter for the stock move.
@@ -167,6 +182,14 @@ module ErpIntegration
167
182
  @product_adapter || :fulfil
168
183
  end
169
184
 
185
+ def product_category_adapter
186
+ @product_category_adapter || :fulfil
187
+ end
188
+
189
+ def product_template_adapter
190
+ @product_template_adapter || :fulfil
191
+ end
192
+
170
193
  def production_order_adapter
171
194
  @production_order_adapter || :fulfil
172
195
  end
@@ -199,6 +222,10 @@ module ErpIntegration
199
222
  @supplier_shipment_adapter || :fulfil
200
223
  end
201
224
 
225
+ def stock_bin_transfer_adapter
226
+ @stock_bin_transfer_adapter || :fulfil
227
+ end
228
+
202
229
  def stock_move_adapter
203
230
  @stock_move_adapter || :fulfil
204
231
  end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative '../api_resource'
4
+
5
+ module ErpIntegration
6
+ module Fulfil
7
+ module Resources
8
+ class ProductCategory < ApiResource
9
+ self.model_name = 'product.category'
10
+ end
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative '../api_resource'
4
+
5
+ module ErpIntegration
6
+ module Fulfil
7
+ module Resources
8
+ class ProductTemplate < ApiResource
9
+ self.model_name = 'product.template'
10
+ end
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,59 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative '../api_resource'
4
+
5
+ module ErpIntegration
6
+ module Fulfil
7
+ module Resources
8
+ class StockBinTransfer < ApiResource
9
+ self.model_name = 'stock.bin_transfer'
10
+
11
+ # Allows bulk force assign bin transfers over the API to move assigned
12
+ # inventory to the new bin location.
13
+ # @param id [Integer|String] The ID of the stock bin transfer.
14
+ # @return [boolean] Whether the stock bin transfer was assigned force successfully or not.
15
+ def assign_force(id)
16
+ client.put("model/stock.bin_transfer/#{id}/assign_force")
17
+ true
18
+
19
+ # Fulfil will return an 400 (a.k.a. "Bad Request") status code when a bin trasfer couldn't
20
+ # be done. If a bit trasfer isn't assignable by design, no exception should be raised.
21
+ #
22
+ # See the Fulfil's documentation for more information:
23
+ # https://developers.fulfil.io/rest_api/model/stock.bin_transfer/#force-allocate-inventory-to-the-transfer
24
+ rescue ErpIntegration::HttpError::BadRequest
25
+ false
26
+ # Workaround: Fulfil api does not return a json when status code is 200 (a.k.a. "Ok")
27
+ # and faraday is having an error when trying to parse it. Let's skip the parse error
28
+ # and move on.
29
+ rescue Faraday::ParsingError
30
+ true
31
+ end
32
+
33
+ # Allows bulk mark the bin transfers as done over the API to finish
34
+ # moving the inventory to the new bin location.
35
+ # It is better practice for inventory accuracy to mark the bin transfer
36
+ # as done once the inventory is physically moved to the new location.
37
+ # @param id [Integer|String] The ID of the stock bin transfer.
38
+ # @return [boolean] Whether the stock bin transfer was mark as done successfully or not.
39
+ def done(id)
40
+ client.put("model/stock.bin_transfer/#{id}/done")
41
+ true
42
+
43
+ # Fulfil will return an 400 (a.k.a. "Bad Request") status code when a bin trasfer couldn't
44
+ # be done. If a bit trasfer isn't doneable by design, no exception should be raised.
45
+ #
46
+ # See the Fulfil's documentation for more information:
47
+ # https://developers.fulfil.io/rest_api/model/stock.bin_transfer/#mark-transfer-as-done
48
+ rescue ErpIntegration::HttpError::BadRequest
49
+ false
50
+ # Workaround: Fulfil api does not return a json when status code is 200 (a.k.a. "Ok")
51
+ # and faraday is having an error when trying to parse it. Let's skip the parse error
52
+ # and move on.
53
+ rescue Faraday::ParsingError
54
+ true
55
+ end
56
+ end
57
+ end
58
+ end
59
+ end
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ module ErpIntegration
4
+ # The `ErpIntegration::ProductTemplate` exposes an uniformed API for interaction with
5
+ # third-party ERP vendors.
6
+ class ProductCategory < Resource
7
+ attr_accessor :id, :name, :parent
8
+ end
9
+ end
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ module ErpIntegration
4
+ # The `ErpIntegration::ProductTemplate` exposes an uniformed API for interaction with
5
+ # third-party ERP vendors.
6
+ class ProductTemplate < Resource
7
+ attr_accessor :id, :name, :account_category
8
+ end
9
+ end
@@ -0,0 +1,20 @@
1
+ # frozen_string_literal: true
2
+
3
+ module ErpIntegration
4
+ class StockBinTransfer < Resource
5
+ attr_accessor :id, :attachments, :company, :create_date, :create_uid,
6
+ :description, :effective_date, :messages, :metadata,
7
+ :metafields, :moves, :number, :origin, :picker, :priority,
8
+ :picking_status, :planned_date, :private_notes, :public_notes,
9
+ :quantity_total, :rec_blurb, :rec_name, :reference, :state,
10
+ :storage_zone, :warehouse, :write_date, :write_uid
11
+
12
+ def assign_force
13
+ self.class.adapter.assign_force(id)
14
+ end
15
+
16
+ def done
17
+ self.class.adapter.done(id)
18
+ end
19
+ end
20
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ErpIntegration
4
- VERSION = '0.34.0'
4
+ VERSION = '0.36.0'
5
5
  end
@@ -31,6 +31,8 @@ module ErpIntegration
31
31
  autoload :CustomerShipment, 'erp_integration/customer_shipment'
32
32
  autoload :CustomerShipmentReturn, 'erp_integration/customer_shipment_return'
33
33
  autoload :Product, 'erp_integration/product'
34
+ autoload :ProductCategory, 'erp_integration/product_category'
35
+ autoload :ProductTemplate, 'erp_integration/product_template'
34
36
  autoload :ProductionOrder, 'erp_integration/production_order'
35
37
  autoload :PurchaseOrder, 'erp_integration/purchase_order'
36
38
  autoload :PurchaseOrderLine, 'erp_integration/purchase_order_line'
@@ -39,6 +41,7 @@ module ErpIntegration
39
41
  autoload :SalesOrder, 'erp_integration/sales_order'
40
42
  autoload :SalesOrderLine, 'erp_integration/sales_order_line'
41
43
  autoload :SalesReturnReason, 'erp_integration/sales_return_reason'
44
+ autoload :StockBinTransfer, 'erp_integration/stock_bin_transfer'
42
45
  autoload :StockMove, 'erp_integration/stock_move'
43
46
  autoload :SupplierShipment, 'erp_integration/supplier_shipment'
44
47
  autoload :Task, 'erp_integration/task'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: erp_integration
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.34.0
4
+ version: 0.36.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stefan Vermaas
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-06-23 00:00:00.000000000 Z
11
+ date: 2023-08-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -290,6 +290,8 @@ files:
290
290
  - lib/erp_integration/fulfil/resources/customer_shipment_return.rb
291
291
  - lib/erp_integration/fulfil/resources/gift_card.rb
292
292
  - lib/erp_integration/fulfil/resources/product.rb
293
+ - lib/erp_integration/fulfil/resources/product_category.rb
294
+ - lib/erp_integration/fulfil/resources/product_template.rb
293
295
  - lib/erp_integration/fulfil/resources/production_order.rb
294
296
  - lib/erp_integration/fulfil/resources/purchase_order.rb
295
297
  - lib/erp_integration/fulfil/resources/purchase_order_line.rb
@@ -297,6 +299,7 @@ files:
297
299
  - lib/erp_integration/fulfil/resources/sales_order.rb
298
300
  - lib/erp_integration/fulfil/resources/sales_order_line.rb
299
301
  - lib/erp_integration/fulfil/resources/sales_return_reason.rb
302
+ - lib/erp_integration/fulfil/resources/stock_bin_transfer.rb
300
303
  - lib/erp_integration/fulfil/resources/stock_move.rb
301
304
  - lib/erp_integration/fulfil/resources/supplier_shipment.rb
302
305
  - lib/erp_integration/fulfil/resources/task.rb
@@ -306,6 +309,8 @@ files:
306
309
  - lib/erp_integration/gift_card.rb
307
310
  - lib/erp_integration/middleware/error_handling.rb
308
311
  - lib/erp_integration/product.rb
312
+ - lib/erp_integration/product_category.rb
313
+ - lib/erp_integration/product_template.rb
309
314
  - lib/erp_integration/production_order.rb
310
315
  - lib/erp_integration/purchase_order.rb
311
316
  - lib/erp_integration/purchase_order_line.rb
@@ -317,6 +322,7 @@ files:
317
322
  - lib/erp_integration/sales_order.rb
318
323
  - lib/erp_integration/sales_order_line.rb
319
324
  - lib/erp_integration/sales_return_reason.rb
325
+ - lib/erp_integration/stock_bin_transfer.rb
320
326
  - lib/erp_integration/stock_move.rb
321
327
  - lib/erp_integration/supplier_shipment.rb
322
328
  - lib/erp_integration/task.rb
@@ -347,7 +353,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
347
353
  - !ruby/object:Gem::Version
348
354
  version: '0'
349
355
  requirements: []
350
- rubygems_version: 3.2.3
356
+ rubygems_version: 3.3.7
351
357
  signing_key:
352
358
  specification_version: 4
353
359
  summary: Connects Mejuri with third-party ERP vendors