solidus_bling 1.0.2 → 1.0.3

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: 0b8e475b75ec056e3798fa351403000a591b57c36b4061c087c98f2c2362bbcf
4
- data.tar.gz: 85bc1d58b188c1f351c360c1c169d39a377ccac1e85b5fda4acd7fa15d86e7a1
3
+ metadata.gz: 57eb623fa49a1b9f53dac0ad680791afba17c0b1964ffb68042f3c962362003f
4
+ data.tar.gz: e0063409850eccd59f8a7945b0cdc3cf3cf12a9936d65cd08af5bad5f5272867
5
5
  SHA512:
6
- metadata.gz: bcc3989efb379ba2420bccddbc4bf8964c4cb640a1a6cd6300f3f56c93d118f44fcf60a1f7842c258c0ca312b72f36256eb7f35e4a07eaddcc4b8d4bfd18b7c1
7
- data.tar.gz: 4ac466871db56bf643381bad6d61306336e07496225e83f429b885011f1eaa5134434d43653760413103e39014acb82b19709f6dc16217b342700ea955e40f29
6
+ metadata.gz: 01ab7448075d61c24cd7b7bd95bc964bc9967616e05248c1db21b7b4f1835bc8340b5152dfdadb2eee9adead2e8923165851c5d23582fe9873f3ac5921f9425b
7
+ data.tar.gz: 36fb291c3658ebbe20a303c7a75aea9c58e18a3f37401bbc2131291e3e4fff0150dabc73d677751be7dd52987931196e8f060ccb5a66a03fcb3312fa0475ee4f
@@ -3,10 +3,10 @@ class ErpContactJob < ApplicationJob
3
3
 
4
4
  def perform event:, method_name:
5
5
  erp_event = ErpEvent.new
6
- contact = event.payload[:args][:contato]
7
- order = event.payload[:args][:order]
6
+ contact = event[:args][:contato]
7
+ order = event[:args][:order]
8
8
  erp_event.internal_id = order.id
9
- erp_event.name = event.omnes_event_name
9
+ erp_event.name = "event.omnes_event_name"
10
10
  erp_event.method = method_name
11
11
  if contact.include? "error"
12
12
  erp_event.status = 'error'
@@ -3,9 +3,8 @@ class ErpOrderJob < ApplicationJob
3
3
 
4
4
  def perform event:, method_name:
5
5
  erp_event = ErpEvent.new
6
- order = event.payload[:order]
6
+ order = event[:order]
7
7
  erp_event.internal_id = order.id
8
- erp_event.name = event.omnes_event_name
9
8
  erp_event.method = method_name
10
9
  begin
11
10
  Bling::Pedido.new(order).send
@@ -3,8 +3,7 @@ class ErpProductJob < ApplicationJob
3
3
 
4
4
  def perform event:, method_name:
5
5
  erp_event = ErpEvent.new
6
- products = event.payload[:products]
7
- erp_event.name = event.omnes_event_name
6
+ products = event[:products]
8
7
  erp_event.method = method_name
9
8
  erp_event.body = products.to_json
10
9
  erp_event.save!
@@ -14,19 +14,19 @@ module Bling
14
14
  with: :contato_created,
15
15
  id: :contato_created
16
16
 
17
- def send_order_to_bling event
17
+ def send_order_to_bling event, debug_info = {}
18
18
  method = __method__.to_s
19
- ErpOrderJob.perform_later(event: event, method_name: method)
19
+ ErpOrderJob.perform_later(event: event.payload, method_name: method)
20
20
  end
21
21
 
22
- def contato_created event
22
+ def contato_created event, debug_info = {}
23
23
  method = __method__.to_s
24
- ErpContactJob.perform_later(event: event, method_name: method)
24
+ ErpContactJob.perform_later(event: event.payload, method_name: method)
25
25
  end
26
26
 
27
- def products_updated event
27
+ def products_updated event, debug_info = {}
28
28
  method = __method__.to_s
29
- ErpProductJob.perform_later(event: event, method_name: method)
29
+ ErpProductJob.perform_later(event: event.payload, method_name: method)
30
30
  end
31
31
  end
32
32
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module SolidusBling
4
- VERSION = '1.0.2'
4
+ VERSION = '1.0.3'
5
5
  end
data/lib/solidus_bling.rb CHANGED
@@ -1,5 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require 'solidus_brazilian_adaptations'
3
4
  require 'typhoeus'
4
5
  require 'solidus_bling/configuration'
5
6
  require 'solidus_bling/version'
@@ -31,6 +31,7 @@ Gem::Specification.new do |spec|
31
31
  spec.add_dependency 'solidus_core', ['>= 2.0.0', '< 5']
32
32
  spec.add_dependency 'solidus_support', '~> 0.5'
33
33
  spec.add_dependency 'typhoeus'
34
+ spec.add_dependency 'solidus_brazilian_adaptations'
34
35
 
35
36
  spec.add_development_dependency 'solidus_dev_support', '~> 2.7'
36
37
  end
metadata CHANGED
@@ -1,11 +1,11 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: solidus_bling
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - ulysses-bull
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
11
  date: 2023-09-12 00:00:00.000000000 Z
@@ -58,6 +58,20 @@ dependencies:
58
58
  - - ">="
59
59
  - !ruby/object:Gem::Version
60
60
  version: '0'
61
+ - !ruby/object:Gem::Dependency
62
+ name: solidus_brazilian_adaptations
63
+ requirement: !ruby/object:Gem::Requirement
64
+ requirements:
65
+ - - ">="
66
+ - !ruby/object:Gem::Version
67
+ version: '0'
68
+ type: :runtime
69
+ prerelease: false
70
+ version_requirements: !ruby/object:Gem::Requirement
71
+ requirements:
72
+ - - ">="
73
+ - !ruby/object:Gem::Version
74
+ version: '0'
61
75
  - !ruby/object:Gem::Dependency
62
76
  name: solidus_dev_support
63
77
  requirement: !ruby/object:Gem::Requirement
@@ -72,7 +86,7 @@ dependencies:
72
86
  - - "~>"
73
87
  - !ruby/object:Gem::Version
74
88
  version: '2.7'
75
- description:
89
+ description:
76
90
  email: contato7bulloleo@gmail.com
77
91
  executables: []
78
92
  extensions: []
@@ -142,7 +156,7 @@ metadata:
142
156
  homepage_uri: https://github.com/ulysses-bull/solidus_bling#readme
143
157
  source_code_uri: https://github.com/ulysses-bull/solidus_bling
144
158
  changelog_uri: https://github.com/ulysses-bull/solidus_bling/blob/master/CHANGELOG.md
145
- post_install_message:
159
+ post_install_message:
146
160
  rdoc_options: []
147
161
  require_paths:
148
162
  - lib
@@ -161,7 +175,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
161
175
  version: '0'
162
176
  requirements: []
163
177
  rubygems_version: 3.4.6
164
- signing_key:
178
+ signing_key:
165
179
  specification_version: 4
166
180
  summary: Solidus extension to integrate with the Bling
167
181
  test_files: