Repository navigation
Expand file tree
/
Copy pathnext_steps_for_your_business_flow.rb
More file actions
104 lines (88 loc) · 2.96 KB
/
Copy pathnext_steps_for_your_business_flow.rb
File metadata and controls
104 lines (88 loc) · 2.96 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
class NextStepsForYourBusinessFlow < SmartAnswer::Flow
def define
name "next-steps-for-your-business"
content_id "4d7751b5-d860-4812-aa36-5b8c57253ff2"
status :published
response_store :query_parameters
additional_parameters %i[ct crn]
# ======================================================================
# Will your business take more than £90,000 in a 12 month period?
# ======================================================================
radio :annual_turnover_over_90k do
option :yes
option :no
option :not_sure
on_response do |response|
self.calculator = SmartAnswer::Calculators::NextStepsForYourBusinessCalculator.new
calculator.annual_turnover_over_90k = response
calculator.registered_for_corp_tax = (ct == "true")
end
next_node do
question :employ_someone
end
end
# ======================================================================
# Do you want to employ someone?
# ======================================================================
radio :employ_someone do
option :in_future
option :yes
option :no
option :not_sure
on_response do |response|
calculator.employer = response
end
next_node do
question :activities
end
end
# ======================================================================
# Does your business do any of the following?
# ======================================================================
checkbox_question :activities do
option :import_goods
option :export_goods_or_services
none_option
on_response do |response|
calculator.activities = response.split(",")
end
next_node do
question :financial_support
end
end
# ======================================================================
# Are you looking for financial support for:
# ======================================================================
radio :financial_support do
option :yes
option :no
on_response do |response|
calculator.needs_financial_support = response
end
next_node do
question :business_premises
end
end
# ======================================================================
# Where are you running your business?
# ======================================================================
checkbox_question :business_premises do
option :home
option :rented
option :owned
none_option
on_response do |response|
calculator.business_premises = response.split(",")
end
next_node do
outcome :results
end
end
# ======================================================================
# Outcome
# ======================================================================
outcome :results do
view_template "smart_answers/custom_result"
end
end
end