instant_quote 1.2.0 → 1.3.0

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: ec2e26453b0ed03e414feceb9e8344ff4d502d5f0962f7b509450608278c9b34
4
- data.tar.gz: 830639812afaf22a2f67059a6fb757fc6988e99121deca26ede7eba041738a6f
3
+ metadata.gz: c0e4d676043f18051bcb1f2b7e19d1717f8358b0b91f5045904836e02b298f41
4
+ data.tar.gz: 685fbafd3e28e54cfda323046c128fcb030dcb3ee7f63d43b57883a550f3e1a9
5
5
  SHA512:
6
- metadata.gz: '0822f784c417f72c986a44ecaad692be2a53b227cf09c14a4bb7d7afe5b5db7dd3dd3d070952cc809b38f3c7cb0fe2168e0237629d5a7d70c26b24c71cf2d7f7'
7
- data.tar.gz: '069cc5595bae6a50601f73d4403be3bcaad28b51033beec08f0488a426a51d3f8911a1828c18b00e69ecfbf3d27f24f2b3e68bd00f05091af9e334f5a6bf9e26'
6
+ metadata.gz: fa8b5523e543f875eeb2bd9c35290b362f1be0b68a253d4711bd375f13cbf808781109dd1c283c1c686a5bc398cab7185f519fb2cb97a33d842a9ed705e71a66
7
+ data.tar.gz: 80552793f341720a2030a8fe02a84392c4823daaaf96fa550fe081ece670382f218ed459950547e2157cd6a8bdd08f3a61b7c3c6cf02b84cdf8f676f65c33eeb
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- instant_quote (1.2.0)
4
+ instant_quote (1.3.0)
5
5
  activesupport
6
6
  capital_on_tap
7
7
  iwoca
@@ -12,7 +12,7 @@ PATH
12
12
  GEM
13
13
  remote: https://rubygems.org/
14
14
  specs:
15
- activesupport (6.0.3.2)
15
+ activesupport (6.0.3.3)
16
16
  concurrent-ruby (~> 1.0, >= 1.0.2)
17
17
  i18n (>= 0.7, < 2)
18
18
  minitest (~> 5.1)
@@ -37,6 +37,30 @@ module InstantQuote
37
37
  required: true,
38
38
  if: ->(app) { app.borrower_organisation.sole_trader? }
39
39
  },
40
+ {
41
+ name: 'existing_cbils_loan',
42
+ label: 'Do you already have a CBILS or BBLS loan?',
43
+ required: true,
44
+ choices: {
45
+ 'Yes' => 'true',
46
+ 'No' => 'false'
47
+ },
48
+ type: 'radio'
49
+ },
50
+ {
51
+ name: 'turnover_percentage_after_feb_2020',
52
+ label: 'When compared to before COVID-19, what is your current turnover level?',
53
+ required: true,
54
+ choices: {
55
+ 'Greater than before (>100%)' => '>100%',
56
+ 'Marginally reduced (80-100%)' => '80-100%',
57
+ 'Reduced (60-79%)' => '60-79%',
58
+ 'Halved (40-59%)' => '40-59%',
59
+ 'Less than half (20-39%)' => '20-39%',
60
+ 'Severely reduced or no turnover (<20%)' => '<20%'
61
+ },
62
+ type: 'select'
63
+ },
40
64
  {
41
65
  name: 'applicant_consent',
42
66
  label: 'Yes, I give my consent for my data to be shared',
@@ -57,17 +81,17 @@ module InstantQuote
57
81
 
58
82
  # Get the status for a given application ID
59
83
  # {:applicationStatus=>
60
- # {:locatorId=>"B247T62",
61
- # :applicationStage=>"AppSubmitted",
84
+ # {:locatorId=>'B247T62',
85
+ # :applicationStage=>'AppSubmitted',
62
86
  # :creditDecision=>
63
- # {:status=>"Pending",
87
+ # {:status=>'Pending',
64
88
  # :starRating=>0.0,
65
89
  # :approvalAmount=>0.0,
66
90
  # :monthlyInterestRate=>0.0,
67
91
  # :monthlyCardInterestRate=>0.0,
68
- # :decisionDate=>"2020-01-28T01:44:29.241",
69
- # :creditDecisionReason=>"None"}},
70
- # :links=>{:self=>"/api/v1/Applications/B247T62", :parent=>nil},
92
+ # :decisionDate=>'2020-01-28T01:44:29.241',
93
+ # :creditDecisionReason=>'None'}},
94
+ # :links=>{:self=>'/api/v1/Applications/B247T62', :parent=>nil},
71
95
  # :metaData=>{}
72
96
  # }
73
97
  def get_status(application_id)
@@ -30,57 +30,57 @@ module InstantQuote
30
30
  required: true,
31
31
  type: 'select',
32
32
  choices: [
33
- "Advertising / Marketing",
34
- "Beer / Wine Merchant",
35
- "Builders Merchant",
36
- "Clothing & Fashion",
37
- "Computer Hardware",
38
- "Computer Software",
39
- "Construction",
40
- "Consultancy",
41
- "Contract Cleaning",
42
- "Courier",
43
- "Distribution",
44
- "Driving Agency",
45
- "Electrical Contracting",
46
- "Electrical Wholesaler",
47
- "Engineering - Heavy",
48
- "Engineering - Light",
49
- "Engineering - Precision",
50
- "Fabrication",
51
- "Flooring Contractor",
52
- "Food Manufacture",
53
- "Franchise",
54
- "Free Newspaper",
55
- "Freight Forwarding",
56
- "Fruit Importer",
57
- "Furniture Manufacture",
58
- "Garden Equipment",
59
- "Haulage",
60
- "IT Contracting",
61
- "Jewellery",
62
- "Maintenance",
63
- "Manufacturing",
64
- "Meat Trade",
65
- "Other Services",
66
- "Permanent Recruitment",
67
- "Plant Hire",
68
- "Plastic Injection Moulding",
69
- "Plumbers Merchant",
70
- "Printing",
71
- "Publishing",
72
- "Recycling",
73
- "Security Guards",
74
- "Shopfitting",
75
- "Stationery",
76
- "Steel Stockholding",
77
- "Telecoms",
78
- "Temporary Recruitment",
79
- "Timber Merchant",
80
- "Tooling Manufacture",
81
- "Toys & Fancy Goods",
82
- "Warehousing & Storage",
83
- "Wholesale"
33
+ 'Advertising / Marketing',
34
+ 'Beer / Wine Merchant',
35
+ 'Builders Merchant',
36
+ 'Clothing & Fashion',
37
+ 'Computer Hardware',
38
+ 'Computer Software',
39
+ 'Construction',
40
+ 'Consultancy',
41
+ 'Contract Cleaning',
42
+ 'Courier',
43
+ 'Distribution',
44
+ 'Driving Agency',
45
+ 'Electrical Contracting',
46
+ 'Electrical Wholesaler',
47
+ 'Engineering - Heavy',
48
+ 'Engineering - Light',
49
+ 'Engineering - Precision',
50
+ 'Fabrication',
51
+ 'Flooring Contractor',
52
+ 'Food Manufacture',
53
+ 'Franchise',
54
+ 'Free Newspaper',
55
+ 'Freight Forwarding',
56
+ 'Fruit Importer',
57
+ 'Furniture Manufacture',
58
+ 'Garden Equipment',
59
+ 'Haulage',
60
+ 'IT Contracting',
61
+ 'Jewellery',
62
+ 'Maintenance',
63
+ 'Manufacturing',
64
+ 'Meat Trade',
65
+ 'Other Services',
66
+ 'Permanent Recruitment',
67
+ 'Plant Hire',
68
+ 'Plastic Injection Moulding',
69
+ 'Plumbers Merchant',
70
+ 'Printing',
71
+ 'Publishing',
72
+ 'Recycling',
73
+ 'Security Guards',
74
+ 'Shopfitting',
75
+ 'Stationery',
76
+ 'Steel Stockholding',
77
+ 'Telecoms',
78
+ 'Temporary Recruitment',
79
+ 'Timber Merchant',
80
+ 'Tooling Manufacture',
81
+ 'Toys & Fancy Goods',
82
+ 'Warehousing & Storage',
83
+ 'Wholesale'
84
84
  ]
85
85
  },
86
86
  {
@@ -88,8 +88,8 @@ module InstantQuote
88
88
  label: 'Do you require credit control?',
89
89
  required: false,
90
90
  choices: {
91
- '1' => 'Yes',
92
- '0' => 'No'
91
+ 'Yes' => '1',
92
+ 'No' => '0'
93
93
  },
94
94
  type: 'radio'
95
95
  },
@@ -6,6 +6,60 @@ module InstantQuote
6
6
  module ConnectionTranslators
7
7
  class CapitalOnTap < ConnectionTranslator
8
8
  DEFAULT_SALUTATION = 'Mr'
9
+ LOAN_PURPOSE_MAPPING = {
10
+ 'Apply for COVID-19 support/for other reasons' => 'General working capital requirements',
11
+ 'Apply for COVID-19 support/to pay existing loans' => 'Repay Finances with another lender',
12
+ 'Apply for COVID-19 support/to pay suppliers' => 'General working capital requirements',
13
+ 'Apply for COVID-19 support/to protect jobs' => 'Payment of wages or rent',
14
+ 'Apply for COVID-19 support/to refinance existing loans' => 'Repay Finances with another lender',
15
+ 'Buy or develop property/buy the property my business already occupies' => '',
16
+ 'Buy or develop property/buying a business that includes premises' => 'Acquisition of another business in the UK',
17
+ 'Buy or develop property/buying a property for my business to move into' => '',
18
+ 'Buy or develop property/develop residential or commercial premises' => 'Bridging loan',
19
+ 'Buy or develop property/invest in a foreign property to rent it out' => '',
20
+ 'Buy or develop property/invest in a holiday let' => '',
21
+ 'Buy or develop property/invest in UK property' => 'Bridging loan',
22
+ 'Buy or develop property/other property finance needs' => 'Bridging loan',
23
+ 'Buy or refinance vehicle(s)/agricultural vehicle(s)' => 'General working capital requirements',
24
+ 'Buy or refinance vehicle(s)/car(s)' => 'General working capital requirements',
25
+ 'Buy or refinance vehicle(s)/caravan(s) & mobile home(s)' => 'General working capital requirements',
26
+ 'Buy or refinance vehicle(s)/commercial vehicle(s)' => 'General working capital requirements',
27
+ 'Buy or refinance vehicle(s)/fork lift truck(s)' => 'General working capital requirements',
28
+ 'Buy or refinance vehicle(s)/other vehicle finance requirements' => 'General working capital requirements',
29
+ 'Help with grants, tax credits and pension finance/for a research & development project' => 'Research and development activities',
30
+ 'Help with grants, tax credits and pension finance/for green energy projects' => 'General working capital requirements',
31
+ 'Help with grants, tax credits and pension finance/for projects with social impact' => 'General working capital requirements',
32
+ 'Help with grants, tax credits and pension finance/other grant funding needs' => '',
33
+ 'Help with grants, tax credits and pension finance/starting a business, incl. accelerator and incubator programs' => 'Start up costs',
34
+ 'Help with grants, tax credits and pension finance/to fund skills and training initiatives' => 'General working capital requirements',
35
+ 'Help with grants, tax credits and pension finance/utilise pensions to lend to a business' => '',
36
+ 'Improve cashflow/borrow against monthly income from a credit card terminal' => '',
37
+ 'Improve cashflow/finance overseas trading and exporting' => 'General working capital requirements',
38
+ 'Improve cashflow/other cashflow requirements' => 'General working capital requirements',
39
+ 'Improve cashflow/raise credit against agreed purchase orders' => 'General working capital requirements',
40
+ 'Improve cashflow/release capital from pension fund(s)' => '',
41
+ 'Improve cashflow/release cash from one unpaid invoice to another business' => 'General working capital requirements',
42
+ 'Improve cashflow/release cash from several invoices to other businesses' => 'General working capital requirements',
43
+ 'Improve cashflow/spread the cost of a large bill' => 'General working capital requirements',
44
+ 'Invest in equipment or machinery/computers (hardware, software)' => 'Purchase of equipment/machinery/stock',
45
+ 'Invest in equipment or machinery/equipment (office, printing, medical, etc.)' => 'Purchase of equipment/machinery/stock',
46
+ 'Invest in equipment or machinery/furniture & furnishings' => 'Purchase of equipment/machinery/stock',
47
+ 'Invest in equipment or machinery/machinery & tools' => 'Purchase of equipment/machinery/stock',
48
+ 'Invest in equipment or machinery/other investment needs' => 'Purchase of licences,quotas or other entitlements to trade',
49
+ 'Invest in equipment or machinery/phone & telecom systems' => 'Purchase of equipment/machinery/stock',
50
+ 'Refinance an existing.../asset' => 'Repay Finances with another lender',
51
+ 'Refinance an existing.../business loan' => 'Repay Finances with another lender',
52
+ 'Refinance an existing.../commercial mortgage' => '',
53
+ 'Refinance an existing.../other refinancing needs' => 'Repay Finances with another lender',
54
+ 'Seeking investment/for a management buy-out' => 'Acquisition of another business in the UK',
55
+ 'Seeking investment/other funding requirements' => 'General working capital requirements',
56
+ 'Seeking investment/to launch a new B2B product or service' => 'Start up costs',
57
+ 'Seeking investment/to launch a new consumer product or service' => 'Start up costs',
58
+ 'Seeking investment/to purchase another business' => 'Acquisition of another business in the UK',
59
+ 'Seeking investment/to reach more consumers with a proven product or service' => 'Expansion Activities in the UK',
60
+ 'Seeking investment/to win more business clients with a proven product or service' => 'Expansion Activities in the UK',
61
+ 'Seeking investment/venture builder, accelerator and incubator programs' => ''
62
+ }.freeze
9
63
 
10
64
  # rubocop:disable Metrics/AbcSize
11
65
  def translate
@@ -24,7 +78,8 @@ module InstantQuote
24
78
  MonthlyTurnOver: translate_turnover,
25
79
  BusinessType: translate_business_type,
26
80
  BusinessAddress: translate_address,
27
- RegistrationNumber: app_org.company_number
81
+ RegistrationNumber: app_org.company_number,
82
+ additionalQuestions: additional_questions
28
83
  }
29
84
 
30
85
  # If the borrower organisation is Sole Trader we need to merge two additional fields.
@@ -71,7 +126,7 @@ module InstantQuote
71
126
  }
72
127
  end
73
128
 
74
- # Since in Finpoint the user selects an intervel (i.e. "500,000 - 999,999"). We get the avg
129
+ # Since in Finpoint the user selects an intervel (i.e. '500,000 - 999,999'). We get the avg
75
130
  # on this interval and use that number as the monthly turnover.
76
131
  def translate_turnover
77
132
  turnover = app_org.turnover_range
@@ -93,6 +148,47 @@ module InstantQuote
93
148
  'Partnership'
94
149
  end
95
150
  end
151
+
152
+ def additional_questions
153
+ [
154
+ loan_purpose_question,
155
+ cbils_loan_question,
156
+ turnover_percentage_question
157
+ ]
158
+ end
159
+
160
+ def loan_purpose_question
161
+ {
162
+ question: 'What is the purpose of the loan?',
163
+ answer: translate_loan_purpose,
164
+ questionType: '16'
165
+ }
166
+ end
167
+
168
+ def cbils_loan_question
169
+ question_from_extra_info('existing_cbils_loan', '17')
170
+ end
171
+
172
+ def turnover_percentage_question
173
+ question_from_extra_info('turnover_percentage_after_feb_2020', '20')
174
+ end
175
+
176
+ def question_from_extra_info(name, question_type)
177
+ field = Adapters::CapitalOnTap.additional_fields.find do |f|
178
+ f[:name] == name
179
+ end
180
+
181
+ { question: field[:label], answer: extra_info[field[:name]], questionType: question_type }
182
+ end
183
+
184
+ def translate_loan_purpose
185
+ proceeds_purpose = [
186
+ application.proceeds_purpose&.overview&.name,
187
+ application.proceeds_purpose&.name
188
+ ].join('/')
189
+
190
+ LOAN_PURPOSE_MAPPING[proceeds_purpose]
191
+ end
96
192
  end
97
193
  end
98
194
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module InstantQuote
4
- VERSION = '1.2.0'
4
+ VERSION = '1.3.0'
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.2.0
4
+ version: 1.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - rikas
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-09-11 00:00:00.000000000 Z
11
+ date: 2020-09-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler