huginn_acumen_product_agent 1.6.0 → 1.6.1
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 158ba4f844cb9b68a1e554d322c1cdde320fe46bb3740b22f97c490ef7a4f35f
|
4
|
+
data.tar.gz: c567ef95d19590b6df91f6b961f8f68fa8efc28151c3e446245165b084b273aa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d4d0b0dd3eb5bc6e7490922d37bb7760f9590c0e6737ec377f84b9ff1e743ac388c3676ab15b7ff4e5a1a4898f5c20451b7ab346bbcc5202afecb0f40b576244
|
7
|
+
data.tar.gz: a2422b4b261212d2ae098c71da5ec0adb823704798bb852157019d293fc8ecf656437777ba17b8a4fb9bc5b89f4bbf138ee01c9d126768e5cb9e9faf0a96a03e
|
@@ -95,6 +95,7 @@ class AcumenClient
|
|
95
95
|
<column_name>Inv_Product.Category</column_name>
|
96
96
|
<column_name>Inv_Product.Next_Release</column_name>
|
97
97
|
<column_name>Inv_Product.BO_Reason</column_name>
|
98
|
+
<column_name>Inv_Product.Not_On_Website</column_name>
|
98
99
|
</requested_output>
|
99
100
|
</acusoapRequest>
|
100
101
|
XML
|
@@ -10,7 +10,12 @@ module AcumenProductQueryConcern
|
|
10
10
|
|
11
11
|
def get_products_by_ids(acumen_client, ids)
|
12
12
|
response = acumen_client.get_products(ids)
|
13
|
-
products =
|
13
|
+
products = []
|
14
|
+
|
15
|
+
# Filter out Not_On_Website === '1'
|
16
|
+
unless response[0]['Inv_Product.Not_On_Website']['__content__'] === '1'
|
17
|
+
products = parse_product_request(response)
|
18
|
+
end
|
14
19
|
|
15
20
|
response = acumen_client.get_products_marketing(ids)
|
16
21
|
marketing = parse_product_marketing_request(response)
|
@@ -86,20 +91,24 @@ module AcumenProductQueryConcern
|
|
86
91
|
|
87
92
|
def get_product_categories(acumen_client, products)
|
88
93
|
# fetch categories
|
89
|
-
|
94
|
+
|
95
|
+
skus = products.map { |product| product['model'].map { |m| m['sku'] } }[0]
|
90
96
|
response = acumen_client.get_product_categories(skus)
|
91
97
|
categories = process_product_categories_query(response)
|
92
98
|
|
93
99
|
# map categories to products
|
94
100
|
products.each do |product|
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
101
|
+
product['model'].each do |variant|
|
102
|
+
variant['categories'] = []
|
103
|
+
sku = variant['sku']
|
104
|
+
if categories[sku]
|
105
|
+
active = categories[sku].select { |c| c['inactive'] == '0' }
|
106
|
+
active.map do |category|
|
107
|
+
variant['categories'].push({
|
108
|
+
'@type' => 'Thing',
|
109
|
+
'identifier' => category['category_id']
|
110
|
+
})
|
111
|
+
end
|
103
112
|
end
|
104
113
|
end
|
105
114
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: huginn_acumen_product_agent
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.6.
|
4
|
+
version: 1.6.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jacob Spizziri
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-11-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|