erp_integration 0.33.0 → 0.35.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: 3ac97590f290e26055da9668b54eda483dd7aa197d2c131ed129898af7722818
4
- data.tar.gz: f2b35c2a82dc71e4fb520dcbc119b0ed2c0668157620c190002452956c381a12
3
+ metadata.gz: 4bf1b8a88038684ef2a0192d9980e29c13fa8c5b2ea5078478d47db28fe6d050
4
+ data.tar.gz: e5e37d4c3c39647d1a1118a946f0e1808eaffa2a60b373e4a681f5942f48afce
5
5
  SHA512:
6
- metadata.gz: 7b271c8b16571c28015c5ce11387831a1ab434953e32106396dbb324e9a9b08d82aacfc270637a81db51de40bae78ceff1430ba85e4fd63c8275ab108ca856a2
7
- data.tar.gz: 9f513bc64319f18136f5f0e11aefe6a7b69e83deb0023af6227bb299f5324231369eb2ba655bd4940b2dbeae623f1c5ff205f978a3dd477cea46ed22e1a9c0ee
6
+ metadata.gz: d23ae16ce5d712adf1ecb1ae6af31feaf29d773214281546902cc641496e89894fbac35ce3a6da05cd2248ca1b674e589ea3be62114112d32b77933dc3df3465
7
+ data.tar.gz: 6990bf1cacbf87418692ca4ed5b2b63b16e181f4e35b94de5843a5c3b661a5cad55603809318098c23aaada1ba778bb0e5009d49e443a31ea5fff3a9d58ed858
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:
@@ -97,11 +97,21 @@ module ErpIntegration
97
97
  # @return [Symbol] The configured adapter for the supplier shipment.
98
98
  attr_writer :supplier_shipment_adapter
99
99
 
100
+ # Allows configuring an adapter for the `StockBinTransfer` resource. When
101
+ # none is configured, it will default to Fulfil.
102
+ # @return [Symbol] The configured adapter for the stock bin transfer.
103
+ attr_writer :stock_bin_transfer_adapter
104
+
100
105
  # Allows configuring an adapter for the `StockMove` resource. When
101
106
  # none is configured, it will default to Fulfil.
102
107
  # @return [Symbol] The configured adapter for the stock move.
103
108
  attr_writer :stock_move_adapter
104
109
 
110
+ # Allows configuring an adapter for the `Task` resource. When
111
+ # none is configured, it will default to Fulfil.
112
+ # @return [Symbol] The configured adapter for the task.
113
+ attr_writer :task_adapter
114
+
105
115
  # Allows configuring an adapter for the `TrackingNumber` resource. When
106
116
  # none is configured, it will default to Fulfil.
107
117
  # @return [Symbol] The configured adapter for the tracking number.
@@ -194,10 +204,18 @@ module ErpIntegration
194
204
  @supplier_shipment_adapter || :fulfil
195
205
  end
196
206
 
207
+ def stock_bin_transfer_adapter
208
+ @stock_bin_transfer_adapter || :fulfil
209
+ end
210
+
197
211
  def stock_move_adapter
198
212
  @stock_move_adapter || :fulfil
199
213
  end
200
214
 
215
+ def task_adapter
216
+ @task_adapter || :fulfil
217
+ end
218
+
201
219
  def tracking_number_adapter
202
220
  @tracking_number_adapter || :fulfil
203
221
  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,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative '../api_resource'
4
+
5
+ module ErpIntegration
6
+ module Fulfil
7
+ module Resources
8
+ class Task < ApiResource
9
+ self.model_name = 'task'
10
+ end
11
+ end
12
+ end
13
+ 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
@@ -0,0 +1,11 @@
1
+ # frozen_string_literal: true
2
+
3
+ module ErpIntegration
4
+ class Task < Resource
5
+ attr_accessor :id, :attachments, :batch, :create_date, :create_uid,
6
+ :customer_shipment, :done_at, :messages, :metadata, :metafields,
7
+ :name, :operation, :origin, :owner, :private_notes, :public_notes,
8
+ :rec_blurb, :rec_name, :requester, :started_at, :state, :stock_move,
9
+ :template, :type, :write_date, :write_uid
10
+ end
11
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ErpIntegration
4
- VERSION = '0.33.0'
4
+ VERSION = '0.35.0'
5
5
  end
@@ -39,8 +39,10 @@ module ErpIntegration
39
39
  autoload :SalesOrder, 'erp_integration/sales_order'
40
40
  autoload :SalesOrderLine, 'erp_integration/sales_order_line'
41
41
  autoload :SalesReturnReason, 'erp_integration/sales_return_reason'
42
+ autoload :StockBinTransfer, 'erp_integration/stock_bin_transfer'
42
43
  autoload :StockMove, 'erp_integration/stock_move'
43
44
  autoload :SupplierShipment, 'erp_integration/supplier_shipment'
45
+ autoload :Task, 'erp_integration/task'
44
46
  autoload :TrackingNumber, 'erp_integration/tracking_number'
45
47
  autoload :Webhook, 'erp_integration/webhook'
46
48
  autoload :GiftCard, 'erp_integration/gift_card'
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.33.0
4
+ version: 0.35.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stefan Vermaas
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-05-15 00:00:00.000000000 Z
11
+ date: 2023-06-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -224,7 +224,7 @@ dependencies:
224
224
  - - '='
225
225
  - !ruby/object:Gem::Version
226
226
  version: 1.19.2
227
- description:
227
+ description:
228
228
  email:
229
229
  - stefan@knowndecimal.com
230
230
  executables: []
@@ -297,8 +297,10 @@ files:
297
297
  - lib/erp_integration/fulfil/resources/sales_order.rb
298
298
  - lib/erp_integration/fulfil/resources/sales_order_line.rb
299
299
  - lib/erp_integration/fulfil/resources/sales_return_reason.rb
300
+ - lib/erp_integration/fulfil/resources/stock_bin_transfer.rb
300
301
  - lib/erp_integration/fulfil/resources/stock_move.rb
301
302
  - lib/erp_integration/fulfil/resources/supplier_shipment.rb
303
+ - lib/erp_integration/fulfil/resources/task.rb
302
304
  - lib/erp_integration/fulfil/resources/tracking_number.rb
303
305
  - lib/erp_integration/fulfil/resources/webhook.rb
304
306
  - lib/erp_integration/fulfil/where_clause.rb
@@ -316,8 +318,10 @@ files:
316
318
  - lib/erp_integration/sales_order.rb
317
319
  - lib/erp_integration/sales_order_line.rb
318
320
  - lib/erp_integration/sales_return_reason.rb
321
+ - lib/erp_integration/stock_bin_transfer.rb
319
322
  - lib/erp_integration/stock_move.rb
320
323
  - lib/erp_integration/supplier_shipment.rb
324
+ - lib/erp_integration/task.rb
321
325
  - lib/erp_integration/tracking_number.rb
322
326
  - lib/erp_integration/types/decimal.rb
323
327
  - lib/erp_integration/version.rb
@@ -330,7 +334,7 @@ metadata:
330
334
  homepage_uri: https://www.github.com/mejuri-inc/erp-integration
331
335
  source_code_uri: https://www.github.com/mejuri-inc/erp-integration
332
336
  changelog_uri: https://www.github.com/mejuri-inc/erp-integration/blob/main/CHANGELOG.md
333
- post_install_message:
337
+ post_install_message:
334
338
  rdoc_options: []
335
339
  require_paths:
336
340
  - lib
@@ -345,8 +349,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
345
349
  - !ruby/object:Gem::Version
346
350
  version: '0'
347
351
  requirements: []
348
- rubygems_version: 3.3.7
349
- signing_key:
352
+ rubygems_version: 3.2.3
353
+ signing_key:
350
354
  specification_version: 4
351
355
  summary: Connects Mejuri with third-party ERP vendors
352
356
  test_files: []