erp_integration 0.39.0 → 0.41.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/pull_requests.yml +1 -1
- data/lib/erp_integration/configuration.rb +9 -0
- data/lib/erp_integration/fulfil/api_resource.rb +11 -0
- data/lib/erp_integration/fulfil/query_methods.rb +14 -1
- data/lib/erp_integration/fulfil/resources/internal_shipment.rb +13 -0
- data/lib/erp_integration/internal_shipment.rb +18 -0
- data/lib/erp_integration/version.rb +1 -1
- data/lib/erp_integration.rb +2 -0
- metadata +5 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3364aa85a9b1d3b5c6fdf8085e91b8727020772f979331448e8b31ae918e52d8
|
4
|
+
data.tar.gz: 2222316cc1daedb2866a69f9dffbce135b5531bcadd3e4efdb3eb5737ade6263
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 463e2af9f9c6748f5e38555dce0bf51e25991b9c565a3edb4cb6f7bbf873d9fc72a5a97a725a568a47a623fd917985c3e3a0c1c14d612b850b2420e579878886
|
7
|
+
data.tar.gz: 5c37a546111331bf5db94c5f0ce57349461724ff2ea4d91f458b5c1505115c0a4cd899c7f706c44c57a245cf5acc2d06028e88251ce7f73994a6b077fd5a8990
|
@@ -52,6 +52,11 @@ module ErpIntegration
|
|
52
52
|
# @return [Symbol] The configured adapter for the customer shipment.
|
53
53
|
attr_writer :customer_shipment_return_adapter
|
54
54
|
|
55
|
+
# Allows configuring an adapter for the `InternalShipment` resource.
|
56
|
+
# When none is configured, it will default to Fulfil.
|
57
|
+
# @return [Symbol] The configured adapter for the internal shipment.
|
58
|
+
attr_writer :internal_shipment_adapter
|
59
|
+
|
55
60
|
# Allows configuring an adapter for the `Location` resource. When
|
56
61
|
# none is configured, it will default to Fulfil.
|
57
62
|
# @return [Symbol] The configured adapter for the location.
|
@@ -183,6 +188,10 @@ module ErpIntegration
|
|
183
188
|
@customer_shipment_return_adapter || :fulfil
|
184
189
|
end
|
185
190
|
|
191
|
+
def internal_shipment_adapter
|
192
|
+
@internal_shipment_adapter || :fulfil
|
193
|
+
end
|
194
|
+
|
186
195
|
def location_adapter
|
187
196
|
@location_adapter || :fulfil
|
188
197
|
end
|
@@ -129,6 +129,17 @@ module ErpIntegration
|
|
129
129
|
end
|
130
130
|
end
|
131
131
|
|
132
|
+
# Finds a list of resources by using query params to filter the results.
|
133
|
+
# This method is not compatible with the `where` method since it uses
|
134
|
+
# the GET HTTP method to fetch the results.
|
135
|
+
#
|
136
|
+
# @return [Array] An enumerable collection object with all API results.
|
137
|
+
def find_with_query
|
138
|
+
client.get(
|
139
|
+
"model/#{model_name}?#{query_params}"
|
140
|
+
).map { |item| resource_klass.new(item) }
|
141
|
+
end
|
142
|
+
|
132
143
|
private
|
133
144
|
|
134
145
|
# Builds the relative resource path and adds the context if needed.
|
@@ -7,7 +7,7 @@ require_relative 'or_clause'
|
|
7
7
|
module ErpIntegration
|
8
8
|
module Fulfil
|
9
9
|
module QueryMethods
|
10
|
-
attr_accessor :selected_fields, :where_clauses, :or_clauses
|
10
|
+
attr_accessor :selected_fields, :where_clauses, :or_clauses, :query_params
|
11
11
|
|
12
12
|
# The `QueryMethods#select` works in two unique ways
|
13
13
|
#
|
@@ -143,6 +143,19 @@ module ErpIntegration
|
|
143
143
|
where(args.merge!(domain: domain))
|
144
144
|
end
|
145
145
|
|
146
|
+
# The `with_url_options` method provides an interface for querying resources
|
147
|
+
# in Fulfil by using URL query parameters
|
148
|
+
#
|
149
|
+
# @example
|
150
|
+
# $ ErpIntegration::SupplierShipment.with_url_options(created_at_min: Time.zone.now.iso8601).find_with_query
|
151
|
+
# # => <ErpIntegration::Fulfil::Collection @items=[<ErpIntegration::SupplierShipment @id=100 />] />
|
152
|
+
#
|
153
|
+
def with_url_options(args)
|
154
|
+
self.query_params = args.to_query
|
155
|
+
|
156
|
+
self
|
157
|
+
end
|
158
|
+
|
146
159
|
def where_ilike(args)
|
147
160
|
where(args.merge(comparison_operator: 'ilike'))
|
148
161
|
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module ErpIntegration
|
4
|
+
# The `ErpIntegration::InternalShipment` exposes an uniformed API for interaction with
|
5
|
+
# third-party ERP vendors.
|
6
|
+
class InternalShipment < Resource
|
7
|
+
attr_accessor :acknowledged_by_receiving_3pl_at, :acknowledged_by_shipping_3pl_at, :aes_itn, :attachments, :carrier,
|
8
|
+
:carrier_cost_method, :carrier_service, :company, :contents_explanation, :contents_type, :cost,
|
9
|
+
:cost_currency, :create_date, :create_uid, :customs_items, :eel_pfc, :effective_date,
|
10
|
+
:effective_start_date, :from_location, :from_warehouse, :id, :incoming_moves, :incoterm,
|
11
|
+
:is_inter_warehouse, :is_international_shipping, :metadata, :number, :outgoing_moves, :packer,
|
12
|
+
:picked_at, :picker, :picking_status, :planned_date, :planned_start_date, :quantity_received,
|
13
|
+
:quantity_to_be_received, :quantity_total, :received_by, :reference, :request_confirmation,
|
14
|
+
:sent_to_3pl_at, :sent_to_receiving_3pl_at, :shipped_at, :shipped_by, :shipping_instructions,
|
15
|
+
:shipping_label_date, :shipping_manifest, :sscc_code, :state, :to_location, :to_warehouse,
|
16
|
+
:total_quantity, :tracking_number, :weight, :write_date, :write_uid
|
17
|
+
end
|
18
|
+
end
|
data/lib/erp_integration.rb
CHANGED
@@ -4,6 +4,7 @@ require 'active_support'
|
|
4
4
|
require 'active_support/core_ext/string/inflections'
|
5
5
|
require 'active_support/core_ext/module/delegation' # Allows using `delegate`
|
6
6
|
require 'active_support/core_ext/object/blank'
|
7
|
+
require 'active_support/core_ext/object/to_query'
|
7
8
|
require 'faraday'
|
8
9
|
require 'faraday_middleware'
|
9
10
|
require 'json'
|
@@ -30,6 +31,7 @@ module ErpIntegration
|
|
30
31
|
autoload :ChannelListing, 'erp_integration/channel_listing'
|
31
32
|
autoload :CustomerShipment, 'erp_integration/customer_shipment'
|
32
33
|
autoload :CustomerShipmentReturn, 'erp_integration/customer_shipment_return'
|
34
|
+
autoload :InternalShipment, 'erp_integration/internal_shipment'
|
33
35
|
autoload :Location, 'erp_integration/location'
|
34
36
|
autoload :Product, 'erp_integration/product'
|
35
37
|
autoload :ProductCategory, 'erp_integration/product_category'
|
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.
|
4
|
+
version: 0.41.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: 2024-
|
11
|
+
date: 2024-02-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -289,6 +289,7 @@ files:
|
|
289
289
|
- lib/erp_integration/fulfil/resources/customer_shipment.rb
|
290
290
|
- lib/erp_integration/fulfil/resources/customer_shipment_return.rb
|
291
291
|
- lib/erp_integration/fulfil/resources/gift_card.rb
|
292
|
+
- lib/erp_integration/fulfil/resources/internal_shipment.rb
|
292
293
|
- lib/erp_integration/fulfil/resources/location.rb
|
293
294
|
- lib/erp_integration/fulfil/resources/product.rb
|
294
295
|
- lib/erp_integration/fulfil/resources/product_category.rb
|
@@ -308,6 +309,7 @@ files:
|
|
308
309
|
- lib/erp_integration/fulfil/resources/webhook.rb
|
309
310
|
- lib/erp_integration/fulfil/where_clause.rb
|
310
311
|
- lib/erp_integration/gift_card.rb
|
312
|
+
- lib/erp_integration/internal_shipment.rb
|
311
313
|
- lib/erp_integration/location.rb
|
312
314
|
- lib/erp_integration/middleware/error_handling.rb
|
313
315
|
- lib/erp_integration/product.rb
|
@@ -355,7 +357,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
355
357
|
- !ruby/object:Gem::Version
|
356
358
|
version: '0'
|
357
359
|
requirements: []
|
358
|
-
rubygems_version: 3.
|
360
|
+
rubygems_version: 3.4.10
|
359
361
|
signing_key:
|
360
362
|
specification_version: 4
|
361
363
|
summary: Connects Mejuri with third-party ERP vendors
|