/
question_navigation.rb
191 lines (154 loc) · 5.5 KB
/
question_navigation.rb
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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
class QuestionNavigation
FLOW = [
# Triage
Questions::WelcomeController,
Questions::FileWithHelpController,
Questions::AlreadyFiledController,
Questions::FilingForStimulusController,
Questions::StimulusRecommendationController, # possible off-boarding from flow
Questions::BacktaxesController,
Questions::StartWithCurrentYearController,
# VITA eligibility checks
Questions::EligibilityController,
# Overview
Questions::OverviewController,
# Contact information
Questions::PersonalInfoController,
Questions::ChatWithUsController,
Questions::PhoneNumberController,
Questions::EmailAddressController,
Questions::ReturningClientController, # possible off-boarding from flow
Questions::NotificationPreferenceController,
# Consent
Questions::ConsentController, # create Zendesk ticket
# Primary filer personal information
Questions::WasStudentController,
Questions::OnVisaController,
Questions::HadDisabilityController,
Questions::WasBlindController,
Questions::IssuedIdentityPinController,
# Marital Status
Questions::EverMarriedController, # Begins requiring ZD ticket
Questions::MarriedController,
Questions::LivedWithSpouseController,
Questions::SeparatedController,
Questions::SeparatedYearController,
Questions::DivorcedController,
Questions::DivorcedYearController,
Questions::WidowedController,
Questions::WidowedYearController,
# Filing status
Questions::FilingJointController,
# Alimony
Questions::ReceivedAlimonyController,
Questions::PaidAlimonyController,
# Spouse email
Questions::SpouseEmailAddressController,
# Spouse personal information
Questions::SpouseConsentController,
Questions::SpouseWasStudentController,
Questions::SpouseOnVisaController,
Questions::SpouseHadDisabilityController,
Questions::SpouseWasBlindController,
Questions::SpouseIssuedIdentityPinController,
# Dependents
Questions::HadDependentsController,
# Dependent related questions
Questions::DependentCareController,
Questions::AdoptedChildController,
# Student questions
Questions::StudentController,
Questions::StudentLoanInterestController,
# Income from working
Questions::JobCountController,
Questions::OtherStatesController,
Questions::WagesController,
Questions::SelfEmploymentController,
Questions::TipsController,
# Income from benefits
Questions::UnemploymentIncomeController,
Questions::DisabilityIncomeController,
# Investment income/loss
Questions::InterestIncomeController,
Questions::AssetSaleIncomeController,
Questions::AssetSaleLossController,
# Retirement income/contributions
Questions::SocialSecurityIncomeController,
Questions::RetirementIncomeController,
Questions::RetirementContributionsController,
# Other income
Questions::OtherIncomeController,
Questions::OtherIncomeTypesController,
# Health insurance
Questions::HealthInsuranceController,
Questions::HsaController,
# Itemizing
Questions::MedicalExpensesController,
Questions::CharitableContributionsController,
Questions::GamblingIncomeController,
Questions::SchoolSuppliesController,
Questions::LocalTaxController,
Questions::LocalTaxRefundController,
# Related to home ownership
Questions::SoldHomeController,
Questions::MortgageInterestController,
Questions::HomebuyerCreditController,
# Miscellaneous
Questions::DisasterLossController,
Questions::DebtForgivenController,
Questions::IrsLetterController,
Questions::TaxCreditDisallowedController,
Questions::EstimatedTaxPaymentsController,
Questions::SelfEmploymentLossController,
Questions::EnergyEfficientPurchasesController,
# Additional Information
Questions::AdditionalInfoController, # appends 13614-C & consent PDF to Zendesk ticket
# Documents --> See DocumentNavigation
Questions::OverviewDocumentsController,
# Interview time preferences
Questions::InterviewSchedulingController,
# Payment info
Questions::RefundPaymentController,
Questions::SavingsOptionsController,
Questions::BalancePaymentController,
Questions::BankDetailsController,
Questions::MailingAddressController,
# Optional Demographic Questions
Questions::DemographicQuestionsController,
Questions::DemographicEnglishConversationController,
Questions::DemographicEnglishReadingController,
Questions::DemographicDisabilityController,
Questions::DemographicVeteranController,
Questions::DemographicPrimaryRaceController,
Questions::DemographicSpouseRaceController,
Questions::DemographicPrimaryEthnicityController,
Questions::DemographicSpouseEthnicityController,
# Additional Information
Questions::FinalInfoController, # appends final 13614-C, bank details & docs to Zendesk
Questions::SuccessfullySubmittedController,
].freeze
class << self
delegate :first, to: :controllers
def controllers
FLOW
end
end
delegate :controllers, to: :class
def initialize(current_controller)
@current_controller = current_controller
end
def next
return unless index
controllers_until_end = controllers[index + 1..-1]
seek(controllers_until_end)
end
private
def index
controllers.index(@current_controller.class)
end
def seek(list)
list.detect do |controller_class|
controller_class.show?(@current_controller.current_intake)
end
end
end