diff --git a/app/components/status_tag/component.rb b/app/components/status_tag/component.rb index ce7498cc57..38d6365775 100644 --- a/app/components/status_tag/component.rb +++ b/app/components/status_tag/component.rb @@ -53,7 +53,7 @@ def tags received_reference: "purple", rejected: "red", requested: "yellow", - review: "purple", + review: "pink", submitted: "grey", valid: "green", verification: "yellow", diff --git a/app/controllers/assessor_interface/review_verifications_controller.rb b/app/controllers/assessor_interface/review_verifications_controller.rb index c50468cbe9..786f1c6f56 100644 --- a/app/controllers/assessor_interface/review_verifications_controller.rb +++ b/app/controllers/assessor_interface/review_verifications_controller.rb @@ -10,6 +10,8 @@ def index @professional_standing_request = assessment.professional_standing_request if assessment.professional_standing_request.verify_failed? + + render layout: "full_from_desktop" end private diff --git a/app/helpers/region_helper.rb b/app/helpers/region_helper.rb index 6368cef49e..c0f545bfb4 100644 --- a/app/helpers/region_helper.rb +++ b/app/helpers/region_helper.rb @@ -12,7 +12,7 @@ def region_certificate_phrase(region) end def region_teaching_authority_name(region) - region.teaching_authority_name.presence || "teaching authority" + region.teaching_authority_name.presence || "relevant competent authority" end def region_teaching_authority_name_phrase(region) diff --git a/app/models/assessment.rb b/app/models/assessment.rb index ed1dfa3180..ea2270278c 100644 --- a/app/models/assessment.rb +++ b/app/models/assessment.rb @@ -98,7 +98,9 @@ def can_award? all_qualification_requests_review_passed? && professional_standing_request_verify_passed? elsif review? - professional_standing_request_review_passed? + enough_reference_requests_review_passed? && + all_qualification_requests_review_passed? && + professional_standing_request_review_passed? else false end @@ -112,13 +114,29 @@ def can_decline? any_preliminary_section_failed? || (all_sections_finished? && any_section_failed? && any_section_declines?) elsif request_further_information? - any_further_information_request_failed? - elsif review? - professional_standing_request_review_failed? + all_further_information_requests_reviewed? && + any_further_information_requests_failed? elsif verify? - enough_reference_requests_reviewed? && - all_qualification_requests_reviewed? && - professional_standing_request_verified? && !can_review? && !can_award? + return false if professional_standing_request_verify_failed? + + unless enough_reference_requests_reviewed? && + all_qualification_requests_reviewed? && + professional_standing_request_verify_passed? + return false + end + + !enough_reference_requests_review_passed? || + any_qualification_requests_review_failed? + elsif review? + unless enough_reference_requests_reviewed? && + all_qualification_requests_reviewed? && + professional_standing_request_reviewed? + return false + end + + !enough_reference_requests_review_passed? || + any_qualification_requests_review_failed? || + professional_standing_request_review_failed? else false end @@ -206,14 +224,22 @@ def no_section_declines? sections.none?(&:declines_assessment?) end + def all_further_information_requests_reviewed? + further_information_requests.present? && + further_information_requests.all?(&:reviewed?) + end + def all_further_information_requests_passed? further_information_requests.present? && further_information_requests.all?(&:review_passed?) end - def any_further_information_request_failed? - further_information_requests.present? && - further_information_requests.any?(&:review_failed?) + def any_further_information_requests_failed? + further_information_requests.any?(&:review_failed?) + end + + def enough_reference_requests_reviewed? + references_verified || reference_requests.empty? end def enough_reference_requests_review_passed? @@ -234,48 +260,37 @@ def enough_reference_requests_review_passed? months_count >= 9 end - def enough_reference_requests_reviewed? - references_verified || reference_requests.empty? + def all_qualification_requests_reviewed? + qualification_requests.all?(&:reviewed?) end def all_qualification_requests_review_passed? - if qualification_requests.present? - qualification_requests.all?(&:review_passed?) - else - true - end + qualification_requests.all?(&:review_passed?) end - def all_qualification_requests_reviewed? - if qualification_requests.present? - qualification_requests.all?(&:reviewed?) - else - true - end + def any_qualification_requests_review_failed? + qualification_requests.any?(&:review_failed?) end - def professional_standing_request_review_passed? + def professional_standing_request_reviewed? if professional_standing_request_part_of_verification? - professional_standing_request.review_passed? + professional_standing_request.reviewed? else true end end - def professional_standing_request_verified? + def professional_standing_request_review_passed? if professional_standing_request_part_of_verification? - professional_standing_request.verified? + professional_standing_request.review_passed? else true end end def professional_standing_request_review_failed? - if professional_standing_request_part_of_verification? + professional_standing_request_part_of_verification? && professional_standing_request.review_failed? - else - false - end end def professional_standing_request_verify_passed? @@ -287,11 +302,8 @@ def professional_standing_request_verify_passed? end def professional_standing_request_verify_failed? - if professional_standing_request_part_of_verification? + professional_standing_request_part_of_verification? && professional_standing_request.verify_failed? - else - false - end end def professional_standing_request_part_of_verification? diff --git a/app/models/concerns/requestable.rb b/app/models/concerns/requestable.rb index 6889e0131d..bd4ebc49c8 100644 --- a/app/models/concerns/requestable.rb +++ b/app/models/concerns/requestable.rb @@ -60,7 +60,7 @@ def verify_failed? def status if verify_passed? || review_passed? - "accepted" + "completed" elsif review_failed? "rejected" elsif verify_failed? diff --git a/app/views/assessor_interface/application_forms/status.html.erb b/app/views/assessor_interface/application_forms/status.html.erb index c222ce63d1..ca7c7ce383 100644 --- a/app/views/assessor_interface/application_forms/status.html.erb +++ b/app/views/assessor_interface/application_forms/status.html.erb @@ -9,10 +9,6 @@ <%= govuk_panel(title_text: "QTS application #{@view_object.application_form.reference} has been #{@view_object.status.downcase}") %> <% end %> -<% unless @view_object.application_form.waiting_on? %> -
The status of this application has been changed to ’<%= @view_object.status %>‘.
-<% end %> - <% if @view_object.assessment.review? %>An assessor will now review the application and make a decision on awarding or declining QTS.
<% elsif @view_object.application_form.declined? %> diff --git a/app/views/assessor_interface/assessment_recommendation_verify/edit_professional_standing.html.erb b/app/views/assessor_interface/assessment_recommendation_verify/edit_professional_standing.html.erb index 5cec798e4f..55e7099814 100644 --- a/app/views/assessor_interface/assessment_recommendation_verify/edit_professional_standing.html.erb +++ b/app/views/assessor_interface/assessment_recommendation_verify/edit_professional_standing.html.erb @@ -6,7 +6,7 @@If you choose to verify this applicant’s letter of professional standing, you’ll need to email the competent authority directly, then come back to record the outcome.
+If you choose to verify this application's LoPS an admin will email the competent authority and record the response.
<%= f.govuk_collection_radio_buttons :verify_professional_standing, %i[true false], :itself, legend: nil %> diff --git a/app/views/assessor_interface/professional_standing_requests/show.html.erb b/app/views/assessor_interface/professional_standing_requests/show.html.erb index 4b864737bd..cd21887ef4 100644 --- a/app/views/assessor_interface/professional_standing_requests/show.html.erb +++ b/app/views/assessor_interface/professional_standing_requests/show.html.erb @@ -4,7 +4,7 @@- You need to request verification for this applications LoPS. Follow the steps below: + You need to request verification for this application’s LoPS.
<%= render(TaskList::Component.new( diff --git a/app/views/assessor_interface/review_verifications/index.html.erb b/app/views/assessor_interface/review_verifications/index.html.erb index 3afc20c8d4..851ca653d2 100644 --- a/app/views/assessor_interface/review_verifications/index.html.erb +++ b/app/views/assessor_interface/review_verifications/index.html.erb @@ -3,16 +3,27 @@+ The following verification tasks have been flagged for review: +
+ +<%= render(TaskList::Component.new( if @professional_standing_request.present? - table.with_caption(text: "LoPS") - table.with_body do |body| - body.with_row do |row| - row.with_cell { govuk_link_to region_certificate_name(@application_form.region), [:review, :assessor_interface, @application_form, @assessment, :professional_standing_request] } - row.with_cell { render(StatusTag::Component.new(@professional_standing_request.review_status)) } - end - end + [ + { + title: "LoPS", + items: [ + { + name: region_teaching_authority_name(@application_form.region).upcase_first, + link: [:review, :assessor_interface, @application_form, @assessment, :professional_standing_request], + status: @professional_standing_request.review_status, + } + ], + } + ] end -end %> +)) %> -<%= govuk_button_link_to "Back to overview", [:assessor_interface, @application_form] %> +