erp_integration 0.32.0 → 0.34.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 68d6ab5f0b8acef6529a34e21cd851993017341ad68c7c1fb1dfb1ccd2762edd
4
- data.tar.gz: b2ee68b1369e4cc4eee5bb479cae9f12eee26f0d892db7a4b1e93e7fa7c3c31c
3
+ metadata.gz: 46c2613fa4d588241f06f9a130cdc5fece97ba69c5e732d66d4ff141adabb080
4
+ data.tar.gz: 71e0908f8b3fbfcf89a28d15445cd8d3b170a19ba81182c0af03be0933a64631
5
5
  SHA512:
6
- metadata.gz: 0b1b421b5dd434a0a5607a78ffc5935a65c5f6c867bd964547689cf1a90fcccfb991aad1fcc04d36090bdbc32ac8b9da6ba25efee8264dc7e83f13c5bf5c70ca
7
- data.tar.gz: 329629ed3de09845cd3c9eeb1114f3ca96d245bea2970f423e5e74efe501ca2b1d2bfe48044ad97ed652a254bc561e2f66193a7c59193913d64379f10f3e6b85
6
+ metadata.gz: 273b05cc0dbf4030cb6a0a39788614165aba29392795e196228987300a74043a81760ded720d8ba548f0c74708293bb0e845add3b4f3ecef7d69e3939fb5a558
7
+ data.tar.gz: 0e8969487347f3a661ffaa5c789b65fae4da98f1c2e117f19aef0286e86a8856b70f70e71b095c48d5698f39112fea808ef28620935308f268fb74574b211a69
@@ -102,6 +102,11 @@ module ErpIntegration
102
102
  # @return [Symbol] The configured adapter for the stock move.
103
103
  attr_writer :stock_move_adapter
104
104
 
105
+ # Allows configuring an adapter for the `Task` resource. When
106
+ # none is configured, it will default to Fulfil.
107
+ # @return [Symbol] The configured adapter for the task.
108
+ attr_writer :task_adapter
109
+
105
110
  # Allows configuring an adapter for the `TrackingNumber` resource. When
106
111
  # none is configured, it will default to Fulfil.
107
112
  # @return [Symbol] The configured adapter for the tracking number.
@@ -198,6 +203,10 @@ module ErpIntegration
198
203
  @stock_move_adapter || :fulfil
199
204
  end
200
205
 
206
+ def task_adapter
207
+ @task_adapter || :fulfil
208
+ end
209
+
201
210
  def tracking_number_adapter
202
211
  @tracking_number_adapter || :fulfil
203
212
  end
@@ -100,6 +100,35 @@ module ErpIntegration
100
100
  all.each(&block)
101
101
  end
102
102
 
103
+ # Iterates over each page of results and yields it for processing.
104
+ #
105
+ # It fetches each page of results and yields it to the provided block for
106
+ # processing. The loop continues until there are no more results to process.
107
+ #
108
+ # @example
109
+ # ErpIntegration::SalesOrder.select(:id, :total_amount, :state).find_each do |orders|
110
+ # orders.each do |order|
111
+ # puts "#{order.id},$#{order.total_amount['decimal']},#{order.state}"
112
+ # end
113
+ # end
114
+ #
115
+ # => 5887403,$478.12,draft
116
+ # => 5884252,$1497.03,draft
117
+ # ...
118
+ # => 5742565,$78.75,draft
119
+ #
120
+ # @yield [results] Yields the current page of results to the provided block
121
+ # for processing.
122
+ # @yieldparam results [Array] An array of results for the current page.
123
+ # @return [nil]
124
+ def find_each
125
+ page = 1
126
+ while (results = clone.page(page)).any?
127
+ yield results
128
+ page += 1
129
+ end
130
+ end
131
+
103
132
  private
104
133
 
105
134
  # Builds the relative resource path and adds the context if needed.
@@ -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,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.32.0'
4
+ VERSION = '0.34.0'
5
5
  end
@@ -41,6 +41,7 @@ module ErpIntegration
41
41
  autoload :SalesReturnReason, 'erp_integration/sales_return_reason'
42
42
  autoload :StockMove, 'erp_integration/stock_move'
43
43
  autoload :SupplierShipment, 'erp_integration/supplier_shipment'
44
+ autoload :Task, 'erp_integration/task'
44
45
  autoload :TrackingNumber, 'erp_integration/tracking_number'
45
46
  autoload :Webhook, 'erp_integration/webhook'
46
47
  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.32.0
4
+ version: 0.34.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-05-05 00:00:00.000000000 Z
11
+ date: 2023-06-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -299,6 +299,7 @@ files:
299
299
  - lib/erp_integration/fulfil/resources/sales_return_reason.rb
300
300
  - lib/erp_integration/fulfil/resources/stock_move.rb
301
301
  - lib/erp_integration/fulfil/resources/supplier_shipment.rb
302
+ - lib/erp_integration/fulfil/resources/task.rb
302
303
  - lib/erp_integration/fulfil/resources/tracking_number.rb
303
304
  - lib/erp_integration/fulfil/resources/webhook.rb
304
305
  - lib/erp_integration/fulfil/where_clause.rb
@@ -318,6 +319,7 @@ files:
318
319
  - lib/erp_integration/sales_return_reason.rb
319
320
  - lib/erp_integration/stock_move.rb
320
321
  - lib/erp_integration/supplier_shipment.rb
322
+ - lib/erp_integration/task.rb
321
323
  - lib/erp_integration/tracking_number.rb
322
324
  - lib/erp_integration/types/decimal.rb
323
325
  - lib/erp_integration/version.rb
@@ -345,7 +347,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
345
347
  - !ruby/object:Gem::Version
346
348
  version: '0'
347
349
  requirements: []
348
- rubygems_version: 3.2.22
350
+ rubygems_version: 3.2.3
349
351
  signing_key:
350
352
  specification_version: 4
351
353
  summary: Connects Mejuri with third-party ERP vendors