Skip to content

Commit

Permalink
Require verification for all applications
Browse files Browse the repository at this point in the history
This means applications with reduced evidence or where work history
isn't required are still required to go through verification of their
qualifications or LoPS.
  • Loading branch information
thomasleese committed Feb 15, 2024
1 parent 08009eb commit c8f5ae7
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 62 deletions.
19 changes: 9 additions & 10 deletions app/models/assessment.rb
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,7 @@ def can_award?
if application_form.created_under_new_regulations?
return false if induction_required.nil?

if skip_verification?
all_sections_or_further_information_requests_passed?
elsif verify?
if verify?
enough_reference_requests_verify_passed? &&
all_qualification_requests_review_passed? &&
professional_standing_request_verify_passed?
Expand Down Expand Up @@ -164,8 +162,8 @@ def can_review?
end

def can_verify?
return false unless unknown? || request_further_information?
return false unless application_form.created_under_new_regulations?
return false if skip_verification?

all_sections_or_further_information_requests_passed?
end
Expand Down Expand Up @@ -208,6 +206,7 @@ def all_reference_requests_verified?
end

def enough_reference_requests_verify_passed?
return true if reference_requests.empty?
return false if any_reference_requests_verify_failed?

work_history_duration =
Expand Down Expand Up @@ -264,6 +263,7 @@ def all_reference_requests_reviewed?
end

def enough_reference_requests_review_passed?
return true if reference_requests.empty?
return false unless all_reference_requests_reviewed?

WorkHistoryDuration.for_ids(
Expand All @@ -288,7 +288,11 @@ def all_qualification_requests_reviewed?
end

def all_qualification_requests_review_passed?
qualification_requests.all?(&:review_passed?)
if application_form.reduced_evidence_accepted
qualification_requests.all?(&:reviewed?)
else
qualification_requests.all?(&:review_passed?)
end
end

def any_qualification_requests_review_failed?
Expand Down Expand Up @@ -348,11 +352,6 @@ def professional_standing_request_part_of_verification?
professional_standing_request.present?
end

def skip_verification?
!application_form.needs_work_history ||
application_form.reduced_evidence_accepted
end

def all_sections_or_further_information_requests_passed?
(unknown? && all_sections_passed?) ||
(request_further_information? && all_further_information_requests_passed?)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<hr class="govuk-section-break govuk-section-break--m govuk-section-break--visible" />
<% end %>

<p class="govuk-body">If you’re happy to proceed, read the declaration and if you want to award, select ‘Continue’.</p>
<p class="govuk-body">If you’re happy to proceed, read the declaration and if you want to award, select ‘Accept and award QTS’.</p>
<p class="govuk-body"><%= t("assessor_interface.assessment_recommendation.back_instruction") %></p>

<%= f.govuk_check_boxes_fieldset :declaration, multiple: false, small: true do %>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@

<hr class="govuk-section-break govuk-section-break--m govuk-section-break--visible" />

<p class="govuk-body">If you’re happy to proceed, read the declaration and if you want to decline, select ‘Continue’.</p>
<p class="govuk-body">If you’re happy to proceed, read the declaration and if you want to decline, select ‘Accept and decline QTS’.</p>
<p class="govuk-body"><%= t("assessor_interface.assessment_recommendation.back_instruction") %></p>

<%= f.govuk_check_boxes_fieldset :declaration, multiple: false, small: true do %>
Expand Down
10 changes: 9 additions & 1 deletion app/views/assessor_interface/assessments/edit.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,11 @@
elsif @assessment.can_review?
t(".hint.can_review")
elsif @assessment.can_award?
t(".hint.can_award")
if @assessment.reference_requests.present?
t(".hint.can_award_with_references")
else
t(".hint.can_award_without_references")
end
else
t(".hint.cant_award")
end %>
Expand All @@ -25,6 +29,10 @@
<h1 class="govuk-heading-xl"><%= title %></h1>
<p class="govuk-body"><%= description %></p>

<% if @assessment.can_award? && @assessment.can_decline? %>
<p class="govuk=body">Note: for <%= CountryName.from_region(@application_form.region, with_definite_article: true) %> applications you can still award QTS if the qualifications could not be verified.
<% end %>

<%= f.govuk_collection_radio_buttons :recommendation,
@assessment.available_recommendations,
:itself,
Expand Down
3 changes: 2 additions & 1 deletion config/locales/assessor_interface.en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ en:
review: Assessment decision
verify: Verification decision
hint:
can_award: You’ve completed your assessment of this QTS application and reviewed the work references.
can_award_with_references: You’ve completed your assessment of this QTS application and reviewed the work references.
can_award_without_references: You’ve completed your assessment of this QTS application.
can_review: You’ve completed your verification checks.
can_verify: You’ve completed your review of this QTS application and marked all sections as complete to your satisfaction.
cant_award: You’ve completed your review of this QTS application and marked 1 or more sections as not completed to your satisfaction.
Expand Down
9 changes: 9 additions & 0 deletions lib/tasks/example_data.rake
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,15 @@ def create_application_forms

assessment = AssessmentFactory.call(application_form:)

if application_form.reduced_evidence_accepted ||
!application_form.needs_work_history
assessment.update!(induction_required: false)
end

if CountryCode.scotland?(application_form.country.code)
assessment.update!(scotland_full_registration: true)
end

if application_form.declined_at.present?
FactoryBot.create(
:selected_failure_reason,
Expand Down
50 changes: 2 additions & 48 deletions spec/models/assessment_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -184,31 +184,11 @@
it { is_expected.to be true }
end

context "with a passed assessment and reduced evidence" do
context "with no reference requests" do
before do
application_form.update!(reduced_evidence_accepted: true)
assessment.update!(induction_required: false)
create(
:assessment_section,
:personal_information,
:passed,
assessment:,
)
assessment.update!(recommendation: "verify", induction_required: true)
end
it { is_expected.to be true }
end

context "with a passed assessment and work history not required" do
before do
application_form.update!(needs_work_history: false)
assessment.update!(induction_required: false)
create(
:assessment_section,
:personal_information,
:passed,
assessment:,
)
end
it { is_expected.to be true }
end
end
Expand Down Expand Up @@ -396,32 +376,6 @@
it { is_expected.to be true }
end

context "with a passed assessment and reduced evidence" do
before do
application_form.update!(reduced_evidence_accepted: true)
create(
:assessment_section,
:personal_information,
:passed,
assessment:,
)
end
it { is_expected.to be false }
end

context "with a passed assessment and work history not required" do
before do
application_form.update!(needs_work_history: false)
create(
:assessment_section,
:personal_information,
:passed,
assessment:,
)
end
it { is_expected.to be false }
end

context "with a failed assessment" do
before do
create(
Expand Down

0 comments on commit c8f5ae7

Please sign in to comment.