Skip to content

Commit

Permalink
Handle existing applications
Browse files Browse the repository at this point in the history
This updates the qualification verification tasks to handle the case
where the qualification has gone out without consent being selected.
  • Loading branch information
thomasleese committed Mar 20, 2024
1 parent 76fed54 commit 4562ea4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
9 changes: 6 additions & 3 deletions app/lib/application_form_status_updater.rb
Original file line number Diff line number Diff line change
Expand Up @@ -164,15 +164,18 @@ def need_to_request_lops?
end

def need_to_request_consent?
qualification_requests.any?(&:consent_method_unknown?) ||
consent_requests.any?(&:not_requested?)
(
qualification_requests.none?(&:requested?) &&
qualification_requests.any?(&:consent_method_unknown?)
) || consent_requests.any?(&:not_requested?)
end

def need_to_request_ecctis?
qualification_requests
.select(&:not_requested?)
.any? do |qualification_request|
qualification_request.consent_method_unsigned? ||
qualification_request.consent_method_none? ||
qualification_request.consent_method_unsigned? ||
consent_requests
.select(&:verify_passed?)
.any? do |consent_request|
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ def all_task_items
end

def all_consent_methods_selected?
qualification_requests.none?(&:consent_method_unknown?)
qualification_requests.none?(&:consent_method_unknown?) ||
qualification_requests.requested.exists?
end

def show_individual_task_items?
Expand Down

0 comments on commit 4562ea4

Please sign in to comment.