huginn_acumen_product_agent 2.1.0 → 2.2.0

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: a0c47e2991b9e5c568b8b7762fbd9286b818401cc8d9f6cbc6b4e9af4d93c3a2
4
- data.tar.gz: 994118245c433230a1b1ea15043bbb9e7d5f83af241c0c2bfae3362d833acb46
3
+ metadata.gz: f92df5343f7bddce53b734d7e08b20163fc02b159da82accf2b774cb5eb4d095
4
+ data.tar.gz: 9ce26767383ff1b75aa168cc70291b98def9028bac9e41f827e2ffa2bc9155dd
5
5
  SHA512:
6
- metadata.gz: 2349ea217eb714518d1c995703a9167527b8589106c38e13559835d621eadb155a90430d6c63927115d3d062369f52005f57b62f5d18a61c0bd2c501dae47401
7
- data.tar.gz: 03f03158f7e226fd518c49d04867f1ae00424992f60aa71b31fc9ab9f7a5bd1aff366a49598580e404775f871ff74f57c22fb432449b946e5395e3778b25621a
6
+ metadata.gz: 13f0a7b2b285fb4399026bbf68724557b0da9735a7e5cf055d928b402b3050d8e5137e8acd799dc9b7f26c9e5b836e4a5c636fe7dd079c4d7b5956973d8aa645
7
+ data.tar.gz: 83fc6b6c51dab7825ba6eda45ac7f1aafaa44153274acc57b907ee48542067e7b654f8c74f1bfa5865a16ddeffd20c9d7d5e6b5fa113b98868ef6152198bee68
@@ -50,9 +50,7 @@ module AcumenQueryConcern
50
50
  status: status,
51
51
  scope: error.scope,
52
52
  message: error.message,
53
- original_error: error.original_error,
54
53
  data: error.data,
55
- trace: error.original_error.backtrace,
56
54
  }
57
55
  end
58
56
  end
@@ -63,7 +63,7 @@ module AlternateProductsQueryConcern
63
63
  issue_error(AcumenAgentError.new(
64
64
  'process_alternate_format_response',
65
65
  'Failed while processing alternate format links',
66
- raw_data,
66
+ { product_id: get_field_value(link, 'Product_Link.Link_From_ID') },
67
67
  error
68
68
  ))
69
69
  end
@@ -129,7 +129,10 @@ module InvProductQueryConcern
129
129
  issue_error(AcumenAgentError.new(
130
130
  'process_inv_product_response',
131
131
  'Failed to load Inventory Product Records',
132
- { raw_data: raw_data },
132
+ {
133
+ product_id: get_field_value(p, 'Inv_Product.ID'),
134
+ sku: get_field_value(p, 'Inv_Product.ProdCode')
135
+ },
133
136
  error,
134
137
  ))
135
138
 
@@ -34,7 +34,7 @@ module ProdMktQueryConcern
34
34
  issue_error(AcumenAgentError.new(
35
35
  'process_inv_status_response',
36
36
  'Failed while processing Prod_Mkt record',
37
- inv_status,
37
+ { sku: get_field_value(inv_status, 'Inv_Status.ProdCode') },
38
38
  error,
39
39
  ))
40
40
  end
@@ -63,7 +63,7 @@ module ProdMktQueryConcern
63
63
  issue_error(AcumenAgentError.new(
64
64
  'map_inv_status_data',
65
65
  'Failed to map inventory data for product',
66
- { product: product, inventory_data: inventory_data },
66
+ { sku: product['sku'] },
67
67
  error,
68
68
  ))
69
69
  end
@@ -62,7 +62,7 @@ module ProdMktQueryConcern
62
62
  issue_error(AcumenAgentError.new(
63
63
  'process_prod_mkt_response',
64
64
  'Failed while processing Prod_Mkt record',
65
- product_marketing,
65
+ { sku: get_field_value(product_marketing, 'ProdMkt.Product_Code') },
66
66
  error,
67
67
  ))
68
68
  end
@@ -150,7 +150,7 @@ module ProdMktQueryConcern
150
150
  issue_error(AcumenAgentError.new(
151
151
  'map_marketing_data',
152
152
  'Failed to map marketing data for product',
153
- { product: product, marketing: marketing },
153
+ { id: product['identifier'], sku: marketing['sku'] },
154
154
  error,
155
155
  ))
156
156
  end
@@ -104,7 +104,7 @@ module ProductContributorsQueryConcern
104
104
  issue_error(AcumenAgentError.new(
105
105
  'map_contributor_data',
106
106
  'Failed while mapping contributor data to products',
107
- { product: product, contributors: contributor_data, contributor_types: contributor_type_data },
107
+ { id: product['identifier'], sku: product['sku'] },
108
108
  error
109
109
  ))
110
110
  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: 2.1.0
4
+ version: 2.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jacob Spizziri
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-03-24 00:00:00.000000000 Z
11
+ date: 2021-05-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -67,7 +67,6 @@ files:
67
67
  - lib/huginn_acumen_product_agent/acumen_client.rb
68
68
  - lib/huginn_acumen_product_agent/acumen_product_agent.rb
69
69
  - lib/huginn_acumen_product_agent/concerns/acumen_query_concern.rb
70
- - lib/huginn_acumen_product_agent/concerns/agent_error_concern.rb
71
70
  - lib/huginn_acumen_product_agent/concerns/alternate_products_query_concern.rb
72
71
  - lib/huginn_acumen_product_agent/concerns/inv_product_query_concern.rb
73
72
  - lib/huginn_acumen_product_agent/concerns/inv_status_query_concern.rb
@@ -1,19 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module AgentErrorConcern
4
- extend ActiveSupport::Concern
5
-
6
- def issue_error(error, status = 500)
7
- # NOTE: Status is intentionally included on the top-level payload so that other
8
- # agents can look for a `payload[:status]` of either 200 or 500 to distinguish
9
- # between success and failure states
10
- create_event payload: {
11
- status: status,
12
- scope: error.scope,
13
- message: error.message,
14
- original_error: error.original_error,
15
- data: error.data,
16
- trace: error.original_error.backtrace,
17
- }
18
- end
19
- end