instant_quote 1.7.25 → 1.7.27
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2424b2348486f6496409333dec6dd3a29aca9b3b9eb0c0c549808fdde325df29
|
4
|
+
data.tar.gz: a5a04c34820b4415b7d15daafd21280e926f53da647179590d22cd829d6c340c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b40aee9090963735341973ef33a4d6b2aa1601c782bcc181ec6cee777eaed3d4db8f66c35fa03e46a2d1b321403f909d886779f7b956e3b89f6717cf9eebad35
|
7
|
+
data.tar.gz: 5cfba07e7046953a5e13081dda4e79c99585060c0679a73244bc19292f94898bdcfd501cf792f48dc23b7a01329462462f778ce5cd2418e9b30489bbb9e0f5b7
|
data/Gemfile.lock
CHANGED
@@ -11,7 +11,7 @@ module InstantQuote
|
|
11
11
|
requests: [
|
12
12
|
amount: application.amount_pennies / 100,
|
13
13
|
duration: { amount: 12, unit: 'months' },
|
14
|
-
purpose:
|
14
|
+
purpose: proceeds_purpose,
|
15
15
|
product_type: product_name,
|
16
16
|
urgency: 'asap'
|
17
17
|
]
|
@@ -21,6 +21,38 @@ module InstantQuote
|
|
21
21
|
|
22
22
|
private
|
23
23
|
|
24
|
+
# Maps the proceeds purpose to a valid value for iwoca.
|
25
|
+
# Possible iwoca values:
|
26
|
+
# - stock_purchase
|
27
|
+
# - bridging_loan
|
28
|
+
# - marketing
|
29
|
+
# - equipment_purchase
|
30
|
+
# - pay_bill
|
31
|
+
# - pay_staff
|
32
|
+
# - refinancing_debt
|
33
|
+
# - financing_client_order
|
34
|
+
# - pay_tax_bill
|
35
|
+
# - other
|
36
|
+
# - null
|
37
|
+
# - recovery_loan_working_capital
|
38
|
+
# - recovery_loan_expansion_or_growth
|
39
|
+
# - recovery_loan_replacing_external_finance
|
40
|
+
#
|
41
|
+
# TODO: There are a lot of proceeds purposes that we don't have a mapping for.
|
42
|
+
def proceeds_purpose
|
43
|
+
purpose = application.proceeds_purpose&.overview&.name
|
44
|
+
case purpose
|
45
|
+
when 'Invest in equipment or machinery'
|
46
|
+
'equipment_purchase'
|
47
|
+
when 'Refinance an existing loan'
|
48
|
+
'refinancing_debt'
|
49
|
+
when 'Buy or refinance vehicle(s)'
|
50
|
+
'equipment_purchase'
|
51
|
+
else
|
52
|
+
'other'
|
53
|
+
end
|
54
|
+
end
|
55
|
+
|
24
56
|
def product_name
|
25
57
|
case connection.adapter
|
26
58
|
when 'iwoca'
|
@@ -163,6 +163,9 @@ module InstantQuote
|
|
163
163
|
end
|
164
164
|
|
165
165
|
def monthly_interest_rate
|
166
|
+
puts "Getting monthly interest rate..."
|
167
|
+
puts "First offer: #{first_offer}"
|
168
|
+
puts "Offers: #{@offers.inspect}"
|
166
169
|
first_offer[:interest_rate]
|
167
170
|
end
|
168
171
|
|
@@ -177,7 +180,7 @@ module InstantQuote
|
|
177
180
|
end
|
178
181
|
|
179
182
|
def first_offer
|
180
|
-
@offers
|
183
|
+
@offers&.first
|
181
184
|
end
|
182
185
|
|
183
186
|
def status_included?(status, status_keys)
|
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.
|
4
|
+
version: 1.7.27
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- rikas
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-09-
|
11
|
+
date: 2023-09-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|