erp_integration 0.40.0 → 0.41.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:
|
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
|
@@ -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
|
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'
|
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
|
-
autorequire:
|
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
|
@@ -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: []
|
@@ -342,7 +342,7 @@ metadata:
|
|
342
342
|
homepage_uri: https://www.github.com/mejuri-inc/erp-integration
|
343
343
|
source_code_uri: https://www.github.com/mejuri-inc/erp-integration
|
344
344
|
changelog_uri: https://www.github.com/mejuri-inc/erp-integration/blob/main/CHANGELOG.md
|
345
|
-
post_install_message:
|
345
|
+
post_install_message:
|
346
346
|
rdoc_options: []
|
347
347
|
require_paths:
|
348
348
|
- lib
|
@@ -357,8 +357,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
357
357
|
- !ruby/object:Gem::Version
|
358
358
|
version: '0'
|
359
359
|
requirements: []
|
360
|
-
rubygems_version: 3.
|
361
|
-
signing_key:
|
360
|
+
rubygems_version: 3.4.10
|
361
|
+
signing_key:
|
362
362
|
specification_version: 4
|
363
363
|
summary: Connects Mejuri with third-party ERP vendors
|
364
364
|
test_files: []
|