huginn_acumen_product_agent 1.2.6 → 1.5.2
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: 7dde4939a6f527acdc57c3cca3b489046521b4f9220e369d76424da6a34e18e5
|
4
|
+
data.tar.gz: dce7f773ea6ff04bf58a98816d6d7f1624e56148c722ee694488c06a10cd84a9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b665673955979aebd6a03fae4f240a40eb4ae4623103ee208bbcaf5ed5b220cc5619584bb0531b5cf8981c5cf2aa304907ab53bbcc402507689d38cb3064137b
|
7
|
+
data.tar.gz: 76435c4a56a302ff36d193ca3e8cb1c42a6ab862e2536b1e31f9b3272826ef25f929450f369f59c5cb66becd189501754b7045e78e32782c8a5bdefe9a4dacba
|
@@ -93,6 +93,8 @@ class AcumenClient
|
|
93
93
|
<column_name>Inv_Product.Info_Alpha_1</column_name>
|
94
94
|
<column_name>Inv_Product.Info_Boolean_1</column_name>>
|
95
95
|
<column_name>Inv_Product.Category</column_name>
|
96
|
+
<column_name>Inv_Product.Next_Release</column_name>
|
97
|
+
<column_name>Inv_Product.BO_Reason</column_name>
|
96
98
|
</requested_output>
|
97
99
|
</acusoapRequest>
|
98
100
|
XML
|
@@ -141,6 +143,7 @@ class AcumenClient
|
|
141
143
|
<column_name>ProdMkt.Info_Text_01</column_name>
|
142
144
|
<column_name>ProdMkt.Info_Text_02</column_name>
|
143
145
|
<column_name>ProdMkt.Religious_Text_Identifier</column_name>
|
146
|
+
<column_name>ProdMkt.Info_Alpha_07</column_name>
|
144
147
|
</requested_output>
|
145
148
|
</acusoapRequest>
|
146
149
|
XML
|
@@ -20,7 +20,16 @@ module AcumenProductQueryConcern
|
|
20
20
|
|
21
21
|
def get_variants_for_ids(acumen_client, ids)
|
22
22
|
result = get_linked_products_by_ids(acumen_client, ids)
|
23
|
-
|
23
|
+
|
24
|
+
# Filtering out duplicate links getting sent from acumen
|
25
|
+
filter = []
|
26
|
+
result.each do |link|
|
27
|
+
if (link['alt_format'].to_s != 0.to_s && !link.in?(filter))
|
28
|
+
filter.push(link)
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
return filter
|
24
33
|
end
|
25
34
|
|
26
35
|
def get_linked_products_by_ids(acumen_client, ids)
|
@@ -106,6 +115,7 @@ module AcumenProductQueryConcern
|
|
106
115
|
'Inv_Product.SubTitle' => 'disambiguatingDescription',
|
107
116
|
'Inv_Product.ISBN_UPC' => 'isbn',
|
108
117
|
'Inv_Product.Pub_Date' => 'datePublished',
|
118
|
+
'Inv_Product.Next_Release' => 'releaseDate',
|
109
119
|
})
|
110
120
|
variant['@type'] = 'ProductModel'
|
111
121
|
variant['isDefault'] = false
|
@@ -117,11 +127,13 @@ module AcumenProductQueryConcern
|
|
117
127
|
variant['offers'] = [{
|
118
128
|
'@type' => 'Offer',
|
119
129
|
'price' => field_value(p, 'Inv_Product.Price_1'),
|
130
|
+
'availability' => field_value(p, 'Inv_Product.BO_Reason')
|
120
131
|
}]
|
121
132
|
if field_value(p, 'Inv_Product.Price_2')
|
122
133
|
variant['offers'].push({
|
123
134
|
'@type' => 'Offer',
|
124
135
|
'price' => field_value(p, 'Inv_Product.Price_2'),
|
136
|
+
'availability' => field_value(p, 'Inv_Product.BO_Reason')
|
125
137
|
})
|
126
138
|
end
|
127
139
|
|
@@ -223,6 +235,7 @@ module AcumenProductQueryConcern
|
|
223
235
|
'ProdMkt.Info_Text_01' => 'info_text_01',
|
224
236
|
'ProdMkt.Info_Text_02' => 'info_text_02',
|
225
237
|
'ProdMkt.Religious_Text_Identifier' => 'religious_text_identifier',
|
238
|
+
'ProdMkt.Info_Alpha_07' => 'info_alpha_07',
|
226
239
|
})
|
227
240
|
|
228
241
|
results[mapped['product_id']] = mapped
|
@@ -276,6 +289,7 @@ module AcumenProductQueryConcern
|
|
276
289
|
product['acumenAttributes']['extent_value'] = marketing['extent_value']
|
277
290
|
product['acumenAttributes']['info_text_01'] = marketing['info_text_01']
|
278
291
|
product['acumenAttributes']['info_text_02'] = marketing['info_text_02']
|
292
|
+
product['acumenAttributes']['info_alpha_07'] = marketing['info_alpha_07']
|
279
293
|
product['acumenAttributes']['meta_description'] = marketing['meta_description']
|
280
294
|
product['acumenAttributes']['religious_text_identifier'] = marketing['religious_text_identifier']
|
281
295
|
product['acumenAttributes']['status'] = marketing['status']
|
@@ -293,9 +307,11 @@ module AcumenProductQueryConcern
|
|
293
307
|
variant['depth'] = quantitative_value(
|
294
308
|
marketing['thickness'], marketing['dimensions_unit_measure']
|
295
309
|
)
|
296
|
-
variant['weight']
|
297
|
-
|
298
|
-
|
310
|
+
if variant['weight']['value'] == '0'
|
311
|
+
variant['weight'] = quantitative_value(
|
312
|
+
marketing['weight'], marketing['weight_unit_measure']
|
313
|
+
)
|
314
|
+
end
|
299
315
|
end
|
300
316
|
end
|
301
317
|
|
@@ -368,9 +384,11 @@ module AcumenProductQueryConcern
|
|
368
384
|
links.each do |link|
|
369
385
|
from_id = link['from_id']
|
370
386
|
to_id = link['to_id']
|
371
|
-
|
372
|
-
|
373
|
-
|
387
|
+
if variants_map.key?(to_id)
|
388
|
+
variant = variants_map[to_id]
|
389
|
+
variant['isDefault'] = false
|
390
|
+
products_map[from_id]['model'].push(*variant['model'])
|
391
|
+
end
|
374
392
|
end
|
375
393
|
|
376
394
|
result = []
|
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.2
|
4
|
+
version: 1.5.2
|
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-10-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|