diff --git a/app/flows/check_uk_visa_flow.rb b/app/flows/check_uk_visa_flow.rb index 205cbeeea2d..654f08496c5 100644 --- a/app/flows/check_uk_visa_flow.rb +++ b/app/flows/check_uk_visa_flow.rb @@ -143,7 +143,7 @@ def define next_node do if calculator.passing_through_uk_border_control? && calculator.passport_country_is_taiwan? outcome :outcome_transit_taiwan_through_border_control - elsif calculator.passing_through_uk_border_control? && requires_a_visitor_in_transit_visa? + elsif calculator.passing_through_uk_border_control? && calculator.requires_a_visitor_in_transit_visa? outcome :outcome_transit_leaving_airport elsif calculator.passing_through_uk_border_control? && calculator.requires_a_direct_airside_transit_visa? outcome :outcome_transit_leaving_airport_direct_airside_transit_visa @@ -172,9 +172,31 @@ def define next_node do if calculator.study_visit? - flow.outcome_study_visit + if calculator.staying_for_over_six_months? + outcome :outcome_study_y # outcome 2 study y + elsif calculator.staying_for_six_months_or_less? && calculator.has_passport_requiring_electronic_visa_waiver_list? + outcome :outcome_study_waiver + elsif calculator.staying_for_six_months_or_less? && calculator.passport_country_is_taiwan? + outcome :outcome_study_waiver_taiwan + elsif calculator.staying_for_six_months_or_less? && (calculator.requires_a_direct_airside_transit_visa? || + calculator.passport_country_in_visa_national_list? || + calculator.travel_document?) + outcome :outcome_study_m # outcome 3 study m visa needed short courses + elsif calculator.staying_for_six_months_or_less? && (calculator.passport_country_in_british_overseas_territories_list? || calculator.passport_country_in_non_visa_national_list? || calculator.passport_country_in_eea?) + outcome :outcome_study_no_visa_needed # outcome 1 no visa needed + end elsif calculator.work_visit? - flow.next_node_for_work_visit + if calculator.staying_for_over_six_months? + question :what_type_of_work? + elsif calculator.staying_for_six_months_or_less? && calculator.has_passport_requiring_electronic_visa_waiver_list? + outcome :outcome_work_waiver + elsif calculator.staying_for_six_months_or_less? && calculator.short_work_visits_are_approved? + # outcome 5.5 work N no visa needed + outcome :outcome_work_n + elsif calculator.staying_for_six_months_or_less? + # outcome 5 work m visa needed short courses + outcome :outcome_work_m + end end end end @@ -354,37 +376,4 @@ def travel_response_next_route(node) end end end - -private - - - def next_node_for_work_visit - if calculator.staying_for_over_six_months? - question :what_type_of_work? - elsif calculator.staying_for_six_months_or_less? && calculator.has_passport_requiring_electronic_visa_waiver_list? - outcome :outcome_work_waiver - elsif calculator.staying_for_six_months_or_less? && calculator.short_work_visits_are_approved? - # outcome 5.5 work N no visa needed - outcome :outcome_work_n - elsif calculator.staying_for_six_months_or_less? - # outcome 5 work m visa needed short courses - outcome :outcome_work_m - end - end - - def outcome_study_visit - if calculator.staying_for_over_six_months? - outcome :outcome_study_y # outcome 2 study y - elsif calculator.staying_for_six_months_or_less? && calculator.has_passport_requiring_electronic_visa_waiver_list? - outcome :outcome_study_waiver - elsif calculator.staying_for_six_months_or_less? && calculator.passport_country_is_taiwan? - outcome :outcome_study_waiver_taiwan - elsif calculator.staying_for_six_months_or_less? && (calculator.requires_a_direct_airside_transit_visa? || - calculator.passport_country_in_visa_national_list? || - calculator.travel_document?) - outcome :outcome_study_m # outcome 3 study m visa needed short courses - elsif calculator.staying_for_six_months_or_less? && (calculator.passport_country_in_british_overseas_territories_list? || calculator.passport_country_in_non_visa_national_list? || calculator.passport_country_in_eea?) - outcome :outcome_study_no_visa_needed # outcome 1 no visa needed - end - end end