zaikio-procurement 2.1.3 → 2.1.4
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 +4 -4
- data/README.md +1 -1
- data/lib/zaikio/procurement/variant.rb +0 -8
- data/lib/zaikio/procurement/variant_search.rb +4 -21
- data/lib/zaikio/procurement/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 5a01d86fae261776a22d5a45836ee072ba969c6e518dd5b51626786f5632a16a
|
|
4
|
+
data.tar.gz: bd1238197f0919b76502d99ca67cedcae8d7958fdf1f9cd4ab354311684857ee
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 4e85b8fc11d8fe0754929521c6bb4e72333023b6ea9c29686d29b0214383e0cd7b2807afc3d2aeaacf1c4e261caa2976dbb7ddf0c9333ea3552e8d0bb13f931e
|
|
7
|
+
data.tar.gz: 9f3b49e4912f9f82019fa75c40a04008523b1222528a33c1dcb7083e01262ce1d8104325b0615cc91ee0914837544ededb863ade618951aa5364d0a03a0baaec
|
data/README.md
CHANGED
|
@@ -34,7 +34,7 @@ end
|
|
|
34
34
|
|
|
35
35
|
The Procurement Client has an ORM like design.
|
|
36
36
|
|
|
37
|
-
For the requests to work, a valid JSON Web token with the correct OAuth Scopes must always be provided. Please refer to [
|
|
37
|
+
For the requests to work, a valid JSON Web token with the correct OAuth Scopes must always be provided. Please refer to [zaikio-oauth_client](https://github.com/zaikio/zaikio-oauth_client).
|
|
38
38
|
|
|
39
39
|
If you want to know which actions are available and which scopes are required, please refer to the [Procurement Consumer API V2 Reference](https://docs.zaikio.com/api/procurement_consumers/consumers_v2.html).
|
|
40
40
|
|
|
@@ -3,14 +3,6 @@ module Zaikio
|
|
|
3
3
|
class Variant < Base
|
|
4
4
|
include_root_in_json :variant
|
|
5
5
|
|
|
6
|
-
# Constants
|
|
7
|
-
def self.types
|
|
8
|
-
%w[carbonless_copy_paper coating coating_plate envelope ink laminating_foil
|
|
9
|
-
offset_printing_blanket plate ring_binding self_adhesive sheet_substrate
|
|
10
|
-
sleeking_foil specialized_printing_blanket web_substrate paper_proofing
|
|
11
|
-
paper_sheetfed paper_webfed].freeze
|
|
12
|
-
end
|
|
13
|
-
|
|
14
6
|
# Attributes
|
|
15
7
|
attributes :type, :summary, :global_trade_item_number, :brightness, :category, :color,
|
|
16
8
|
:dimensions_unit, :form, :grain, :height, :optical_brightness_agent,
|
|
@@ -5,38 +5,21 @@ module Zaikio
|
|
|
5
5
|
@type = type.split.join
|
|
6
6
|
@query = query
|
|
7
7
|
@filters = filters
|
|
8
|
-
@valid_types = Zaikio::Procurement::Variant.types + ["all"]
|
|
9
8
|
|
|
10
9
|
unless @filters.respond_to?(:stringify_keys)
|
|
11
10
|
raise ArgumentError, "When using additional search parameters, you must pass a hash as an argument."
|
|
12
11
|
end
|
|
13
12
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
"When using the type parameter, you must pass one or more of \
|
|
17
|
-
the following types: #{@valid_types.join(', ')}."
|
|
18
|
-
end
|
|
19
|
-
|
|
20
|
-
@response = Zaikio::Procurement::Base.with(path).get
|
|
13
|
+
@response = Zaikio::Procurement::Base
|
|
14
|
+
.request(:get, "variants", type: @type, query: @query, filters: @filters)&.body&.dig("data")
|
|
21
15
|
end
|
|
22
16
|
|
|
23
17
|
def results
|
|
24
|
-
@response
|
|
18
|
+
@response["results"].collect { |variant| Zaikio::Procurement::Variant.new(variant) }
|
|
25
19
|
end
|
|
26
20
|
|
|
27
21
|
def available_filters
|
|
28
|
-
@response
|
|
29
|
-
end
|
|
30
|
-
|
|
31
|
-
private
|
|
32
|
-
|
|
33
|
-
def path
|
|
34
|
-
"variants".tap do |qp|
|
|
35
|
-
qp << "?type=#{@type}"
|
|
36
|
-
qp << "&query=#{@query}" if @query
|
|
37
|
-
qp << "&" if @query && @filters.any?
|
|
38
|
-
qp << @filters.to_query("filters") if @filters
|
|
39
|
-
end
|
|
22
|
+
@response["available_filters"]
|
|
40
23
|
end
|
|
41
24
|
end
|
|
42
25
|
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: zaikio-procurement
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.1.
|
|
4
|
+
version: 2.1.4
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Zaikio GmbH
|
|
@@ -9,7 +9,7 @@ authors:
|
|
|
9
9
|
autorequire:
|
|
10
10
|
bindir: bin
|
|
11
11
|
cert_chain: []
|
|
12
|
-
date:
|
|
12
|
+
date: 2023-02-06 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: concurrent-ruby
|