Skip to content

Commit

Permalink
inline study and work flow blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
FelixMarcusMillne committed Sep 20, 2023
1 parent 2a73cae commit bb792b6
Showing 1 changed file with 25 additions and 36 deletions.
61 changes: 25 additions & 36 deletions app/flows/check_uk_visa_flow.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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

0 comments on commit bb792b6

Please sign in to comment.