Skip to content

Commit

Permalink
Initial changes to DQT copy updates to TRS
Browse files Browse the repository at this point in the history
  • Loading branch information
Hassanmir92 committed Dec 13, 2024
1 parent ce23fe7 commit 612ed49
Show file tree
Hide file tree
Showing 20 changed files with 39 additions and 30 deletions.
1 change: 1 addition & 0 deletions app/components/status_tag/component.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ def tags
overdue_lops: "pink",
overdue_reference: "pink",
potential_duplicate_in_dqt: "pink",
potential_duplicate_in_trs: "pink",
pre_assessment: "pink",
preliminary_check: "pink",
received: "purple",
Expand Down
4 changes: 2 additions & 2 deletions app/jobs/update_trs_trn_request_job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ def perform(trs_trn_request)
trs_trn_request.update!(potential_duplicate:)
end

ApplicationFormStatusUpdater.call(application_form:, user: "DQT")
ApplicationFormStatusUpdater.call(application_form:, user: "TRS")

unless potential_duplicate
AwardQTS.call(
application_form:,
user: "DQT",
user: "TRS",
trn: response[:trn],
access_your_teaching_qualifications_url:
response[:access_your_teaching_qualifications_link],
Expand Down
2 changes: 1 addition & 1 deletion app/lib/application_form_status_updater.rb
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ def statuses
%w[awarded]
elsif trs_trn_request.present?
if trs_trn_request.potential_duplicate?
%w[potential_duplicate_in_dqt]
%w[potential_duplicate_in_trs]
else
%w[awarded_pending_checks]
end
Expand Down
4 changes: 2 additions & 2 deletions app/lib/assessment_factory.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def personal_information_section
(:name_change_document_present if application_form.has_alternative_name),
:duplicate_application,
:applicant_already_qts,
:applicant_already_dqt,
:applicant_already_trs,
].compact

failure_reasons = [
Expand All @@ -55,7 +55,7 @@ def personal_information_section
),
FailureReasons::DUPLICATE_APPLICATION,
FailureReasons::APPLICANT_ALREADY_QTS,
FailureReasons::APPLICANT_ALREADY_DQT,
FailureReasons::APPLICANT_ALREADY_TRS,
].compact

if suitability_active?
Expand Down
1 change: 1 addition & 0 deletions app/lib/failure_reasons.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ class FailureReasons
ADDITIONAL_DEGREE_TRANSCRIPT_ILLEGIBLE =
"additional_degree_transcript_illegible",
APPLICANT_ALREADY_DQT = "applicant_already_dqt",
APPLICANT_ALREADY_TRS = "applicant_already_trs",
APPLICATION_AND_QUALIFICATION_NAMES_DO_NOT_MATCH =
"application_and_qualification_names_do_not_match",
DEGREE_CERTIFICATE_ILLEGIBLE = "degree_certificate_illegible",
Expand Down
4 changes: 2 additions & 2 deletions app/views/assessor_interface/application_forms/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@

<% if (duplicate_matches = @view_object.duplicate_matches).present? %>
<%= govuk_notification_banner(title_text: "Important") do |notification_banner| %>
<% notification_banner.with_heading(text: "Application details match DQT record(s)") %>
<% notification_banner.with_heading(text: "Application details match TRS record(s)") %>

<p class="govuk-body">The surname and date of birth used in this application matches the following records found in the Database of Qualified Teachers (DQT):</p>
<p class="govuk-body">The surname and date of birth used in this application matches the following records found in the Teaching Record System (TRS):</p>

<ul class="govuk-list govuk-list--bullet">
<% duplicate_matches.each do |match| %>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<% elsif @view_object.application_form.declined_at.present? %>
<p class="govuk-body">The application will be deleted after 90 days unless the applicant chooses to appeal.</p>
<% elsif @view_object.application_form.trs_trn_request.present? %>
<p class="govuk-body">This status will appear while the award is reconciled with the information in the Database of Qualified Teachers (DQT).</p>
<p class="govuk-body">This status will appear while the award is reconciled with the information in the Teaching Record System (TRS).</p>
<p class="govuk-body">Once these checks are complete, the status will change to ‘Awarded’ and the applicant will receive the email telling them they’ve been awarded QTS.</p>
<% end %>

Expand Down
2 changes: 1 addition & 1 deletion app/views/shared/_age_range_subjects_form_fields.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

<ul class="govuk-list govuk-list--bullet">
<li>based on evidence, you do not agree with the age range the applicant has submitted</li>
<li>the 'To' age is greater than 19 and will not be accepted by DQT</li>
<li>the 'To' age is greater than 19 and will not be accepted by TRS</li>
</ul>

<%= f.govuk_number_field :age_range_min, width: 3 %>
Expand Down
6 changes: 5 additions & 1 deletion config/locales/assessor_interface.en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,8 @@ en:

checks:
age_range_subjects_matches: that the age range and subjects information the applicant has entered matches the qualifications they’ve provided
applicant_already_dqt: applicant does not already appear in DQT
applicant_already_dqt: applicant does not already appear in TRS
applicant_already_trs: applicant does not already appear in TRS
applicant_already_qts: applicant does not already hold QTS and induction exemption
authorisation_to_teach: confirmation that authorisation to teach has never been suspended, barred, cancelled, revoked or restricted, and there are no sanctions present
confirm_age_range_subjects: confirmation of the age ranges and subjects the applicant is qualified to teach
Expand Down Expand Up @@ -144,6 +145,7 @@ en:
additional_degree_transcript_illegible: An additional degree transcript (or translation) is illegible or in a format that we cannot accept.
age_range: The age range the applicant is qualified to teach does not fall within the requirements of QTS.
applicant_already_dqt: There’s a potential existing match for this applicant. We need to ask for an additional identifier.
applicant_already_trs: There’s a potential existing match for this applicant. We need to ask for an additional identifier.
applicant_already_qts: The applicant already holds QTS and induction exemption.
application_and_qualification_names_do_not_match: The name on the online application form is different from 1 or more qualification documents, but no evidence of change of name was provided.
authorisation_to_teach: Sanctions or restrictions were detected on professional record.
Expand Down Expand Up @@ -274,6 +276,8 @@ en:
blank: Enter a note to the applicant
applicant_already_dqt_notes:
blank: Enter a note to the applicant
applicant_already_trs_notes:
blank: Enter a note to the applicant
applicant_already_qts_notes:
blank: Enter a note to the applicant
application_and_qualification_names_do_not_match_notes:
Expand Down
1 change: 1 addition & 0 deletions config/locales/components.en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ en:
overdue_lops: Overdue LoPS
overdue_reference: Overdue reference
potential_duplicate_in_dqt: Potential duplication in DQT
potential_duplicate_in_trs: Potential duplication in TRS
pre_assessment: Pre-assessment
preliminary_check: Preliminary check
received: Received
Expand Down
2 changes: 2 additions & 0 deletions config/locales/teacher_interface.en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ en:
additional_degree_transcript_illegible: Your additional degree transcript (or translation) is illegible or in a format we cannot accept.
age_range: The age range you are qualified to teach does not fall within the requirements of QTS.
applicant_already_dqt: Your details have been matched with someone who already has QTS and is registered in our database for qualified teachers.
applicant_already_trs: Your details have been matched with someone who already has QTS and is registered in our database for qualified teachers.
applicant_already_qts: You already hold QTS and induction exemption.
application_and_qualification_names_do_not_match: The name on the application form is different from 1 or more qualification documents, but no evidence of change of name has been provided.
authorisation_to_teach: Sanctions or restrictions were detected on your professional record.
Expand Down Expand Up @@ -87,6 +88,7 @@ en:
failure_reason:
age_range: Tell us more about the age range you can teach
applicant_already_dqt: Additional personal information
applicant_already_trs: Additional personal information
english_language_unverifiable_reference_number: Tell us more about your English language proficiency
qualifications_dont_match_other_details: Tell us more about your qualifications
qualifications_dont_match_subjects: Tell us more about the subjects you can teach
Expand Down
4 changes: 2 additions & 2 deletions spec/factories/application_forms.rb
Original file line number Diff line number Diff line change
Expand Up @@ -192,10 +192,10 @@
statuses { %w[awarded_pending_checks] }
end

trait :potential_duplicate_in_dqt do
trait :potential_duplicate_in_trs do
submitted
review_stage
statuses { %w[potential_duplicate_in_dqt] }
statuses { %w[potential_duplicate_in_trs] }
end

trait :awarded do
Expand Down
4 changes: 2 additions & 2 deletions spec/jobs/update_trstrn_request_job_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@

it "changes the state" do
expect { perform }.to change(application_form, :statuses).to(
%w[potential_duplicate_in_dqt],
%w[potential_duplicate_in_trs],
)
end

Expand Down Expand Up @@ -237,7 +237,7 @@

it "changes the state" do
expect { perform }.to change(application_form, :statuses).to(
%w[potential_duplicate_in_dqt],
%w[potential_duplicate_in_trs],
)
end

Expand Down
2 changes: 1 addition & 1 deletion spec/lib/application_form_status_updater_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@

include_examples "changes action required by", "assessor"
include_examples "changes stage", "review"
include_examples "changes statuses", %w[potential_duplicate_in_dqt]
include_examples "changes statuses", %w[potential_duplicate_in_trs]
end

context "with a withdrawn_at date" do
Expand Down
4 changes: 2 additions & 2 deletions spec/lib/assessment_factory_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
identification_document_present
duplicate_application
applicant_already_qts
applicant_already_dqt
applicant_already_trs
],
)
expect(section.failure_reasons).to eq(
Expand All @@ -64,7 +64,7 @@
identification_document_mismatch
duplicate_application
applicant_already_qts
applicant_already_dqt
applicant_already_trs
suitability
suitability_previously_declined
fraud
Expand Down
2 changes: 1 addition & 1 deletion spec/lib/trs/country_code_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

RSpec.describe TRS::CountryCode do
describe "#for_code" do
subject(:dqt_code) { described_class.for_code(code) }
subject(:trs_code) { described_class.for_code(code) }

let(:code) { "US" }

Expand Down
6 changes: 3 additions & 3 deletions spec/lib/trs/subject_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@

RSpec.describe TRS::Subject do
describe "#for" do
subject(:dqt_code) { described_class.for(value) }
subject(:trs_code) { described_class.for(value) }

shared_examples "DQT code" do |value|
shared_examples "TRS code" do |value|
let(:value) { value }
it { is_expected.not_to be_nil }
end

Subject.all.map { |subject| it_behaves_like "DQT code", subject.value }
Subject.all.map { |subject| it_behaves_like "TRS code", subject.value }
end
end
2 changes: 1 addition & 1 deletion spec/services/award_qts_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@

context "with a potential duplicate in QTS application form" do
let(:application_form) do
create(:application_form, :potential_duplicate_in_dqt, teacher:)
create(:application_form, :potential_duplicate_in_trs, teacher:)
end

before { create(:trs_trn_request, application_form:) }
Expand Down
6 changes: 3 additions & 3 deletions spec/system/assessor_interface/completing_assessment_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
it "does not allow any access if assessor is archived" do
given_i_am_authorized_as_an_archived_assessor_user
given_there_is_an_awardable_application_form
given_i_can_request_dqt_api
given_i_can_request_trs_api

when_i_visit_the(
:assessor_complete_assessment_page,
Expand All @@ -23,7 +23,7 @@
it "award" do
given_i_am_authorized_as_an_assessor_user
given_there_is_an_awardable_application_form
given_i_can_request_dqt_api
given_i_can_request_trs_api

when_i_visit_the(
:assessor_complete_assessment_page,
Expand Down Expand Up @@ -268,7 +268,7 @@ def given_there_is_a_declinable_application_form
)
end

def given_i_can_request_dqt_api
def given_i_can_request_trs_api
uri_template =
Addressable::Template.new(
"https://test-teacher-qualifications-api.education.gov.uk/v2/trn-requests/{request_id}",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
it "displays information about the duplicate applicant" do
given_i_am_authorized_as_an_assessor_user
given_there_is_an_application_form
and_the_applicant_matches_a_record_in_dqt
and_the_applicant_matches_a_record_in_trs

when_i_visit_the(:assessor_application_page, reference:)
then_i_see_the_application
and_i_see_the_warning_of_an_existing_record_in_dqt
and_i_see_the_warning_of_an_existing_record_in_trs
end

private
Expand All @@ -30,14 +30,14 @@ def then_i_see_the_application
)
end

def and_i_see_the_warning_of_an_existing_record_in_dqt
def and_i_see_the_warning_of_an_existing_record_in_trs
expect(assessor_application_page).to have_content(
"Application details match DQT record(s)",
"Application details match TRS record(s)",
)
expect(assessor_application_page).to have_content("John Smith, TRN 7654322")
end

def and_the_applicant_matches_a_record_in_dqt
def and_the_applicant_matches_a_record_in_trs
application_form.update!(trs_match:)
end

Expand Down

0 comments on commit 612ed49

Please sign in to comment.