Skip to content

Commit

Permalink
Allow award or decline after review
Browse files Browse the repository at this point in the history
This allows us to award or decline an application after the review
process, rather than only after the verification process.
  • Loading branch information
thomasleese committed Oct 8, 2023
1 parent a91b0c6 commit 024cb7b
Showing 1 changed file with 22 additions and 7 deletions.
29 changes: 22 additions & 7 deletions app/models/assessment.rb
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,14 @@ def can_award?

if skip_verification?
all_sections_or_further_information_requests_passed?
else
verify? && enough_reference_requests_review_passed? &&
elsif verify?
enough_reference_requests_review_passed? &&
all_qualification_requests_review_passed? &&
professional_standing_request_review_passed?
elsif review?
professional_standing_request_review_passed?
else
false
end
else
all_sections_or_further_information_requests_passed?
Expand All @@ -111,6 +115,8 @@ def can_decline?
any_further_information_request_failed?
elsif verify?
true # TODO: check the state of verification requests
elsif review?
professional_standing_request_review_failed?
else
false
end
Expand Down Expand Up @@ -232,13 +238,22 @@ def all_qualification_requests_review_passed?
end
end

def professional_standing_request_review_failed?
if application_form.teaching_authority_provides_written_statement
return true
end
return true if professional_standing_request.nil?

professional_standing_request.review_failed?
end

def professional_standing_request_review_passed?
if !application_form.teaching_authority_provides_written_statement &&
professional_standing_request.present?
professional_standing_request.review_passed?
else
true
if application_form.teaching_authority_provides_written_statement
return true
end
return true if professional_standing_request.nil?

professional_standing_request.review_passed?
end

def skip_verification?
Expand Down

0 comments on commit 024cb7b

Please sign in to comment.