instant_quote 1.7.6 → 1.7.11

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: 96beb49cded7a5171760d6a292781211fbf61b250d7f1d5b272a0d253386bfb9
4
- data.tar.gz: 6a7898c6f6935549623135f789bce38c80f3ffbc5e81c35ab1a86f2c5c8e0d7d
3
+ metadata.gz: ffba40c7420975238c1c63496f7d4081594dbb3939ade51406d407de1880d952
4
+ data.tar.gz: e73d38d429ff63df12e61a8d87ba0a656a1bea8942c2194598d7700c93c31e06
5
5
  SHA512:
6
- metadata.gz: 2a418819d1720e7601349dab5a14e23fb09631f8a23dc427a6b7ac69c5ab9aaf2741acfecfb4c96767fc309d891b9a76e8a7dc43e661ec96757437ea7e2adb43
7
- data.tar.gz: a1d6f7680f96dffe4f403ca116a153d46169d314b2d9ac490b8b65f796594ffbc0c4976f84066f81e3c4d60023f467b8e9cdf7f490087f5983ab9da9c2f15938
6
+ metadata.gz: fd5194b8004e126074acac85bbec75604f47651d0b0a7baa3efd94cef7e51dcd1d6836da620108ffc0033b741d4fee098f1994b63a7c4e4cbbe0dfee66e57d1e
7
+ data.tar.gz: dec874fe32c5fd19cc263f737ee45c6b71b50c484802e49e70e83e5353c5f1ea0ab9f19c538424b057a6e409e69b9bc1f314120ff77f9111120a0a60eac30826
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- instant_quote (1.7.6)
4
+ instant_quote (1.7.11)
5
5
  activesupport
6
6
  capital_on_tap
7
7
  iwoca
@@ -13,7 +13,7 @@ PATH
13
13
  GEM
14
14
  remote: https://rubygems.org/
15
15
  specs:
16
- activesupport (6.1.3)
16
+ activesupport (6.1.3.2)
17
17
  concurrent-ruby (~> 1.0, >= 1.0.2)
18
18
  i18n (>= 1.6, < 2)
19
19
  minitest (>= 5.1)
@@ -36,15 +36,19 @@ GEM
36
36
  diff-lcs (1.4.4)
37
37
  docile (1.3.5)
38
38
  dotenv (2.7.6)
39
- faraday (1.3.0)
39
+ faraday (1.4.1)
40
+ faraday-excon (~> 1.1)
40
41
  faraday-net_http (~> 1.0)
42
+ faraday-net_http_persistent (~> 1.1)
41
43
  multipart-post (>= 1.2, < 3)
42
- ruby2_keywords
44
+ ruby2_keywords (>= 0.0.4)
45
+ faraday-excon (1.1.0)
43
46
  faraday-net_http (1.0.1)
47
+ faraday-net_http_persistent (1.1.0)
44
48
  faraday_middleware (1.0.0)
45
49
  faraday (~> 1.0)
46
50
  hashdiff (1.0.1)
47
- i18n (1.8.9)
51
+ i18n (1.8.10)
48
52
  concurrent-ruby (~> 1.0)
49
53
  iwoca (1.0.0)
50
54
  addressable
@@ -54,7 +58,7 @@ GEM
54
58
  rainbow
55
59
  method_source (1.0.0)
56
60
  minitest (5.14.4)
57
- money (6.14.1)
61
+ money (6.16.0)
58
62
  i18n (>= 0.6.4, <= 2)
59
63
  multi_json (1.15.0)
60
64
  multipart-post (2.1.1)
@@ -67,7 +71,7 @@ GEM
67
71
  parallel (1.20.1)
68
72
  parser (3.0.0.0)
69
73
  ast (~> 2.4.1)
70
- phonelib (0.6.49)
74
+ phonelib (0.6.50)
71
75
  pry (0.13.1)
72
76
  coderay (~> 1.1)
73
77
  method_source (~> 1.0)
@@ -28,18 +28,6 @@ module InstantQuote
28
28
  required: true,
29
29
  if: ->(app) { app.borrower_organisation.sole_trader? }
30
30
  },
31
- {
32
- name: 'turnover_percentage_after_feb_2020',
33
- label: 'What is your current turnover as a percentage of your turnover prior to February 2020?',
34
- required: true,
35
- choices: [
36
- 'My turnover had increased since covid',
37
- 'My turnover is about the same as it was pre-covid (within 20%)',
38
- 'My turnover has fallen materially as a result of covid (20%-60% reduction in turnover)',
39
- 'My turnover has fallen significantly as a result of covid (more than a 60% reduction in turnover)'
40
- ],
41
- type: 'select'
42
- },
43
31
  {
44
32
  name: 'preferred_monthly_repayment_option',
45
33
  label: 'How do you want to set up your direct debit for monthly repayment?',
@@ -11,7 +11,8 @@ module InstantQuote
11
11
  name: 'monthly_card_revenue',
12
12
  label: 'Avg. monthly card revenue',
13
13
  required: true,
14
- type: 'money'
14
+ type: 'money',
15
+ minimum: 1_000
15
16
  },
16
17
  {
17
18
  name: 'monthly_revenue_from_invoices',
@@ -75,7 +76,7 @@ module InstantQuote
75
76
  raise ApiError.new(
76
77
  adapter: 'youlend',
77
78
  data: response.body,
78
- error: response.error || '[Youlend] API error'
79
+ error: response.errors.first || '[Youlend] API error'
79
80
  )
80
81
  end
81
82
  end
@@ -72,9 +72,12 @@ module InstantQuote
72
72
  }
73
73
  end
74
74
 
75
+ # TODO: this is no longer true, but we are still keeping the range for legacy reasons.
75
76
  # Since in Finpoint the user selects an intervel (i.e. '500,000 - 999,999'). We get the avg
76
77
  # on this interval and use that number as the monthly turnover.
77
78
  def translate_turnover
79
+ return app_org.turnover_pennies.to_i if app_org.turnover_pennies
80
+
78
81
  turnover = app_org.turnover_range
79
82
 
80
83
  ((turnover.from + turnover.to) / 2 / 100).ceil
@@ -98,7 +101,6 @@ module InstantQuote
98
101
  def additional_questions
99
102
  [
100
103
  preferred_monthly_repayment_option_question,
101
- turnover_percentage_question,
102
104
  send_cash_from_credit_facility_to_bank_question
103
105
  ]
104
106
  end
@@ -107,10 +109,6 @@ module InstantQuote
107
109
  question_from_extra_info('preferred_monthly_repayment_option', '17')
108
110
  end
109
111
 
110
- def turnover_percentage_question
111
- question_from_extra_info('turnover_percentage_after_feb_2020', '20')
112
- end
113
-
114
112
  def send_cash_from_credit_facility_to_bank_question
115
113
  question_from_extra_info('send_cash_from_credit_facility_to_bank', '23')
116
114
  end
@@ -18,6 +18,8 @@ module InstantQuote
18
18
  # }
19
19
  class Youlend < DecisionParser
20
20
  def approved?
21
+ return false unless status_hash[:loanOptions]
22
+
21
23
  status_hash[:loanOptions].any? && !funded_option.empty?
22
24
  end
23
25
 
@@ -64,7 +66,7 @@ module InstantQuote
64
66
  def status_hash
65
67
  default = { loanOptions: [] }
66
68
 
67
- return default unless data && !data.empty?
69
+ return default unless data && !data.empty? && !data[:error]
68
70
 
69
71
  data
70
72
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module InstantQuote
4
- VERSION = '1.7.6'
4
+ VERSION = '1.7.11'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: instant_quote
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.7.6
4
+ version: 1.7.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - rikas
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-03-23 00:00:00.000000000 Z
11
+ date: 2021-05-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler