zoho_hub 0.1.21 → 0.1.26

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: 7bef57cd4ee9e81ead51f5bffec15c05428ece527014bf0d1cc8b68e1674f1e4
4
- data.tar.gz: 1821d02482af55ee1e8f646372b2ee3d502a2aefe7320d7cffae25c70483894f
3
+ metadata.gz: 7cd6e943b7e3cd1594b439c7462c27030887485fcc474a9c06e745482c916fbc
4
+ data.tar.gz: 17ee52ebedfaff28a92816d9ad780ce11759a3a1ce5efac2c0e0b0babba2f69f
5
5
  SHA512:
6
- metadata.gz: a1169d827f96c290e368b0cb79a5390ef670eb939f94fc14eee26f5d678f25c5c03bcaa827354dce5b34a5961406a5482a72777a2b496a0619363553b094cc40
7
- data.tar.gz: 22d127612237d82e84c79aa9f8602df456bfd4a06d3e1ff7a3b469242aca12974b15e8e924bf983910746d3324411fa230db9306e4af0e27c69665f00533e484
6
+ metadata.gz: ae85f37a8d1001f0d2892e6698532e0870d2632e595b74b4faa5ac62d2aad5c85fd932f5997fc8449efe9fac007f7169737e2e2e53868683c7cc0139c699212c
7
+ data.tar.gz: bcc460d1dda844a548c4260ffcf53c496814270d9396446ccabe96012dda2f2adeafea0a3a291ca48dcd83b727606bafb8929a19452fb8623c658a5ecfc0b20c
data/.gitignore CHANGED
@@ -8,6 +8,7 @@
8
8
  /spec/reports/
9
9
  /tmp/
10
10
  Gemfile.lock
11
+ /cache/
11
12
 
12
13
  # rspec failure tracking
13
14
  .rspec_status
data/lib/zoho_hub.rb CHANGED
@@ -16,6 +16,8 @@ require 'zoho_hub/records/quote'
16
16
  require 'zoho_hub/records/vendor'
17
17
  require 'zoho_hub/records/product'
18
18
  require 'zoho_hub/records/attachment'
19
+ require 'zoho_hub/records/credit_score'
20
+ require 'zoho_hub/records/adverse_criteria'
19
21
 
20
22
  module ZohoHub
21
23
  module_function
@@ -0,0 +1,43 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'zoho_hub/records/base_record'
4
+
5
+ module ZohoHub
6
+ class AdverseCriteria < BaseRecord
7
+ request_path 'Adverse_Criteria'
8
+
9
+ attributes :id, :account_id, :date_decided, :date_paid
10
+ attributes :status, :amount, :currency, :court
11
+ attributes :case_reference, :entity_details, :data_source
12
+
13
+ attribute_translation(
14
+ id: :id,
15
+ case_reference: :Name,
16
+ status: :CCJ_Status,
17
+ amount: :CCJ_Amount,
18
+ data_source: :CCJ_Data_Source,
19
+ date_paid: :Date_paid,
20
+ date_decided: :Date_decided,
21
+ entity_details: :Entity_details
22
+ )
23
+
24
+ def initialize(params)
25
+ attributes.each do |attr|
26
+ zoho_key = attr_to_zoho_key(attr)
27
+
28
+ send("#{attr}=", params[zoho_key] || params[attr])
29
+ end
30
+
31
+ # Setup values as they come from the Zoho API if needed
32
+ @account_id ||= params.dig(:Account, :id)
33
+ end
34
+
35
+ def to_params
36
+ params = super
37
+
38
+ params[:Account] = { id: @account_id } if @account_id
39
+
40
+ params
41
+ end
42
+ end
43
+ end
@@ -49,7 +49,7 @@ module ZohoHub
49
49
 
50
50
  response = get(path, params)
51
51
 
52
- data = response.nil? ? [] : response[:data]
52
+ data = response.nil? ? [] : response.fetch(:data, [])
53
53
 
54
54
  data.map { |info| new(info) }
55
55
  end
@@ -0,0 +1,36 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'zoho_hub/records/base_record'
4
+
5
+ module ZohoHub
6
+ class CreditScore < BaseRecord
7
+ request_path 'Credit_Scores'
8
+
9
+ attributes :id, :account_id, :credit_data_source, :credit_score_band
10
+ attributes :score_description, :credit_score_number, :credit_limit, :currency
11
+
12
+ attribute_translation(
13
+ id: :id,
14
+ credit_score_number: :Name
15
+ )
16
+
17
+ def initialize(params)
18
+ attributes.each do |attr|
19
+ zoho_key = attr_to_zoho_key(attr)
20
+
21
+ send("#{attr}=", params[zoho_key] || params[attr])
22
+ end
23
+
24
+ # Setup values as they come from the Zoho API if needed
25
+ @account_id ||= params.dig(:Account_Name, :id)
26
+ end
27
+
28
+ def to_params
29
+ params = super
30
+
31
+ params[:Account_Name] = { id: @account_id } if @account_id
32
+
33
+ params
34
+ end
35
+ end
36
+ end
@@ -11,6 +11,8 @@ module ZohoHub
11
11
  attributes :campaign_id, :account_id, :contact_id, :campaign_detail, :reviewers_comment
12
12
  attributes :accounting_software, :banking_provider
13
13
  attributes :guarantee_types, :home_ownership_status
14
+ attributes :accountant_id, :vat_registration
15
+ attributes :credit_risk_band, :live_ccjs, :satisfied_ccjs
14
16
 
15
17
  DEFAULTS = {
16
18
  currency: 'GBP',
@@ -25,7 +27,10 @@ module ZohoHub
25
27
  code: :Project_Ref_No,
26
28
  description: :Project_description,
27
29
  employee_count: :Number_of_Employees,
28
- use_proceeds: :use_proceeds
30
+ use_proceeds: :use_proceeds,
31
+ vat_registration: :Pick_List_15,
32
+ live_ccjs: :Live_CCJs,
33
+ satisfied_ccjs: :Satisfied_CCJs
29
34
  )
30
35
 
31
36
  def initialize(params)
@@ -39,6 +44,7 @@ module ZohoHub
39
44
  @account_id ||= params.dig(:Account_Name, :id)
40
45
  @contact_id ||= params.dig(:Contact_Name, :id)
41
46
  @campaign_id ||= params.dig(:Campaign_Source, :id)
47
+ @accountant_id ||= params.dig(:Accountant_Name, :id)
42
48
  end
43
49
 
44
50
  def to_params
@@ -47,6 +53,7 @@ module ZohoHub
47
53
  params[:Campaign_Source] = { id: @campaign_id } if @campaign_id
48
54
  params[:Account_Name] = { id: @account_id } if @account_id
49
55
  params[:Contact_Name] = { id: @contact_id } if @contact_id
56
+ params[:Accountant_Name] = { id: @accountant_id } if @accountant_id
50
57
 
51
58
  params
52
59
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ZohoHub
4
- VERSION = '0.1.21'
4
+ VERSION = '0.1.26'
5
5
  end
data/zoho_hub.gemspec CHANGED
@@ -23,7 +23,7 @@ Gem::Specification.new do |spec|
23
23
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
24
24
  spec.require_paths = ['lib']
25
25
 
26
- spec.add_dependency 'activesupport', '~> 5.2'
26
+ spec.add_dependency 'activesupport', '> 5'
27
27
  spec.add_dependency 'addressable', '~> 2.5'
28
28
  spec.add_dependency 'faraday', '~> 0.15'
29
29
  spec.add_dependency 'faraday_middleware', '~> 0.12'
metadata CHANGED
@@ -1,29 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zoho_hub
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.21
4
+ version: 0.1.26
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ricardo Otero
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-05-08 00:00:00.000000000 Z
11
+ date: 2021-02-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ">"
18
18
  - !ruby/object:Gem::Version
19
- version: '5.2'
19
+ version: '5'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - "~>"
24
+ - - ">"
25
25
  - !ruby/object:Gem::Version
26
- version: '5.2'
26
+ version: '5'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: addressable
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -230,10 +230,12 @@ files:
230
230
  - lib/zoho_hub/connection.rb
231
231
  - lib/zoho_hub/errors.rb
232
232
  - lib/zoho_hub/records/account.rb
233
+ - lib/zoho_hub/records/adverse_criteria.rb
233
234
  - lib/zoho_hub/records/attachment.rb
234
235
  - lib/zoho_hub/records/base_record.rb
235
236
  - lib/zoho_hub/records/campaign.rb
236
237
  - lib/zoho_hub/records/contact.rb
238
+ - lib/zoho_hub/records/credit_score.rb
237
239
  - lib/zoho_hub/records/potential.rb
238
240
  - lib/zoho_hub/records/product.rb
239
241
  - lib/zoho_hub/records/quote.rb
@@ -245,7 +247,7 @@ homepage: https://github.com/rikas/zoho_hub
245
247
  licenses:
246
248
  - MIT
247
249
  metadata: {}
248
- post_install_message:
250
+ post_install_message:
249
251
  rdoc_options: []
250
252
  require_paths:
251
253
  - lib
@@ -260,9 +262,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
260
262
  - !ruby/object:Gem::Version
261
263
  version: '0'
262
264
  requirements: []
263
- rubyforge_project:
265
+ rubyforge_project:
264
266
  rubygems_version: 2.7.6
265
- signing_key:
267
+ signing_key:
266
268
  specification_version: 4
267
269
  summary: Simple gem to connect to Zoho CRM API V2
268
270
  test_files: []