Skip to content

Commit

Permalink
add check for EE result
Browse files Browse the repository at this point in the history
  • Loading branch information
willc-work committed Sep 25, 2024
1 parent be4d024 commit 33bfa28
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
4 changes: 4 additions & 0 deletions app/models/check.rb
Original file line number Diff line number Diff line change
Expand Up @@ -183,4 +183,8 @@ def owns_property_with_mortgage_or_loan?
def owns_property_outright?
Steps::Logic.owns_property_outright?(session_data)
end

def gross_early_eligibility_exit?
session_data["early_eligibility_selection"] == "gross"
end
end
8 changes: 5 additions & 3 deletions app/services/check_answers/section_lister_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,15 @@ def call(session_data)
Sections::Dependants.new(check),
Sections::ClientIncome.new(check),
]
post = [Sections::Outgoings.new(check)]
post = check.gross_early_eligibility_exit? ? [] : [Sections::Outgoings.new(check)]
finance_sections = if check.partner?
pre + [Sections::PartnerIncome.new(check)] + post
pre + (check.gross_early_eligibility_exit? ? [] : [Sections::PartnerIncome.new(check)]) + post
else
pre + post
end
non_finance_sections + finance_sections + assets
assets_sections = check.gross_early_eligibility_exit? ? [] : assets

non_finance_sections + finance_sections + assets_sections
end
end
end
Expand Down

0 comments on commit 33bfa28

Please sign in to comment.