zaig 1.0.8 → 1.0.9

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: 05cec7da728cfbfdf5457960a2d289e4963d22874f9790e12408eb2498aff1de
4
- data.tar.gz: 1b73d0fe9a384e2bb73dd6af74939117329142fa9bf9aa27eeb28ccca5af2f95
3
+ metadata.gz: 92825d985fa1be6233fa33065769e7ebf8c32fc175d10cf850cc50100977c0de
4
+ data.tar.gz: 7ab76c837269a34c050b756734ee93ffdb9641fdc389a20c8906acadfbfcc1be
5
5
  SHA512:
6
- metadata.gz: 7f5c7152922f7a0823b805ad584986ed2c4b2f86484b5ca1f0c5544960cc15a20cbc48a1c0c299eb7b8e226a09d61eb74b5915a928fc4492876b0d7ca8fe4443
7
- data.tar.gz: fa24fdd51580ef3a9f64bc02eda165e2c928fbc087b8595b5570324657e2509def4a510f84ca3452f0b54e24dd15c58ba44a01a9bd41e0a85e780ec8a88944a0
6
+ metadata.gz: 26010f68ed6e2ab3d0f2d35e3083eefabe4c95c7aee950f948cc2e02f5cc8fd9f9294e1994413adad77f2e135c4cf0216f7cce09a05dd4e9587415538ef173f9
7
+ data.tar.gz: ffeda0495121d32edcd1905273b5c190c2cebec78ba0dea58550e6c5766bff83b95f5814fde0e80551d90bf82a232f82e0df428354c875a916f17257c41c5aca
@@ -5,11 +5,9 @@ module Zaig
5
5
  class Registration
6
6
  attr_reader :connection
7
7
 
8
- include Singleton
9
-
10
8
  ENDPOINT = "zaig/consulta_de_credito"
11
9
 
12
- def initialize(connection: Zaig::Connection.new, registration_payload: Zaig::RegistrationPayload.instance)
10
+ def initialize(connection: Zaig::Connection.new, registration_payload: Zaig::RegistrationPayload.new)
13
11
  @connection = connection
14
12
  @registration_payload = registration_payload
15
13
  end
@@ -3,30 +3,28 @@
3
3
  module Zaig
4
4
  # Service class to build a registration payload request.
5
5
  class RegistrationPayload
6
- include Singleton
7
-
8
6
  def call(obj)
9
7
  payload = {
10
- address: build_address(obj[:address]),
11
8
  client_category: obj[:client_category],
12
- constitution_date: obj[:constitution_date],
13
- constitution_type: obj[:constitution_type],
14
9
  credit_request_date: obj[:credit_request_date],
15
10
  credit_type: obj[:credit_type] || "clean",
16
11
  document_number: CNPJ.new(obj[:document_number]).formatted,
17
- email: obj[:email],
18
12
  id: obj[:id],
19
13
  legal_name: obj[:legal_name],
20
14
  monthly_revenue: format_money(obj[:monthly_revenue], require_positive: true),
21
- phones: build_phones(obj[:phones]),
22
- shareholders: build_shareholders(obj[:shareholders]),
23
15
  trading_name: obj[:trading_name]
24
16
  }
25
- payload[:guarantors] = build_shareholders(obj[:guarantors]) if obj.key?(:guarantors)
26
- payload[:financial] = build_financial(obj[:financial]) if obj.key?(:financial)
27
- payload[:scr_parameters] = build_scr_parameters(obj[:scr_parameters]) if obj.key?(:scr_parameters)
28
- payload[:source] = build_source(obj[:source]) if obj.key?(:source)
29
- payload[:warrants] = build_warrants(obj[:warrants]) if obj.key?(:warrants)
17
+ payload[:address] = build_address(obj[:address]) if obj[:address]
18
+ payload[:constitution_date] = obj[:constitution_date] if obj[:constitution_date]
19
+ payload[:constitution_type] = obj[:constitution_type] if obj[:constitution_type]
20
+ payload[:email] = obj[:email] if obj[:email]
21
+ payload[:financial] = build_financial(obj[:financial]) if obj[:financial]
22
+ payload[:guarantors] = build_shareholders(obj[:guarantors]) if obj[:guarantors]
23
+ payload[:phones] = build_phones(obj[:phones]) if obj[:phones]
24
+ payload[:scr_parameters] = build_scr_parameters(obj[:scr_parameters]) if obj[:scr_parameters]
25
+ payload[:shareholders] = build_shareholders(obj[:shareholders]) if obj[:shareholders]
26
+ payload[:source] = build_source(obj[:source]) if obj[:source]
27
+ payload[:warrants] = build_warrants(obj[:warrants]) if obj[:warrants]
30
28
  payload
31
29
  end
32
30
 
data/lib/zaig/version.rb CHANGED
@@ -8,5 +8,5 @@ module Zaig
8
8
  # Major - Incremented for incompatible changes with previous release (or big enough new features)
9
9
  # Minor - Incremented for new backwards-compatible features + deprecations
10
10
  # Patch - Incremented for backwards-compatible bug fixes
11
- VERSION = "1.0.8"
11
+ VERSION = "1.0.9"
12
12
  end
data/lib/zaig.rb CHANGED
@@ -4,7 +4,6 @@ require "cpf_cnpj"
4
4
  require "flash_integration"
5
5
  require "i18n"
6
6
  require "jwt"
7
- require "singleton"
8
7
 
9
8
  require "zaig/base_error"
10
9
  require "zaig/already_exists_error"
@@ -57,7 +56,7 @@ module Zaig
57
56
  end
58
57
 
59
58
  def jwt_exp_time
60
- @jwt_exp_time ||= 1_658_439_475
59
+ @jwt_exp_time ||= 1800
61
60
  end
62
61
 
63
62
  def registration_endpoint
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zaig
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.8
4
+ version: 1.0.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Danilo Carolino
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-07-21 00:00:00.000000000 Z
11
+ date: 2022-07-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cpf_cnpj
@@ -52,20 +52,6 @@ dependencies:
52
52
  - - ">="
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
- - !ruby/object:Gem::Dependency
56
- name: singleton
57
- requirement: !ruby/object:Gem::Requirement
58
- requirements:
59
- - - ">="
60
- - !ruby/object:Gem::Version
61
- version: '0'
62
- type: :runtime
63
- prerelease: false
64
- version_requirements: !ruby/object:Gem::Requirement
65
- requirements:
66
- - - ">="
67
- - !ruby/object:Gem::Version
68
- version: '0'
69
55
  - !ruby/object:Gem::Dependency
70
56
  name: bundler
71
57
  requirement: !ruby/object:Gem::Requirement