diff --git a/app/jobs/find_applicant_in_dqt_job.rb b/app/jobs/find_applicant_in_dqt_job.rb index 53a1b9b8e6..7ffa8c7afc 100644 --- a/app/jobs/find_applicant_in_dqt_job.rb +++ b/app/jobs/find_applicant_in_dqt_job.rb @@ -4,7 +4,6 @@ class FindApplicantInDQTJob < ApplicationJob def perform(application_form_id:) application_form = ApplicationForm.find(application_form_id) teachers = FindTeachersInDQT.call(application_form:, reverse_name: true) - - application_form.update!(dqt_match: teachers.first) if teachers.any? + application_form.update!(dqt_match: { teachers: }) end end diff --git a/app/lib/dqt/client/find_teachers.rb b/app/lib/dqt/client/find_teachers.rb index 840901231d..8ec49d613a 100644 --- a/app/lib/dqt/client/find_teachers.rb +++ b/app/lib/dqt/client/find_teachers.rb @@ -5,6 +5,7 @@ class DQT::Client::FindTeachers include DQT::Client::Connection attr_reader :application_form, :reverse_name + def initialize(application_form:, reverse_name: false) @application_form = application_form @reverse_name = reverse_name diff --git a/app/view_objects/assessor_interface/application_forms_show_view_object.rb b/app/view_objects/assessor_interface/application_forms_show_view_object.rb index 605b1b32be..0824fc0c6c 100644 --- a/app/view_objects/assessor_interface/application_forms_show_view_object.rb +++ b/app/view_objects/assessor_interface/application_forms_show_view_object.rb @@ -14,6 +14,10 @@ def application_form .find(params[:id]) end + def duplicate_matches + dqt_match.fetch("teachers", dqt_match.present? ? [dqt_match] : []) + end + def task_list_sections [ pre_assessment_task_list_section, @@ -75,6 +79,7 @@ def management_tasks attr_reader :params, :current_staff delegate :assessment, + :dqt_match, :teacher, :teaching_authority_provides_written_statement, :work_histories, diff --git a/app/views/assessor_interface/application_forms/show.html.erb b/app/views/assessor_interface/application_forms/show.html.erb index e16d43ce8c..86bfaf8364 100644 --- a/app/views/assessor_interface/application_forms/show.html.erb +++ b/app/views/assessor_interface/application_forms/show.html.erb @@ -2,20 +2,23 @@ <% content_for :back_link_url, assessor_interface_application_forms_path %> <% application_form = @view_object.application_form %> -<% assessment = @view_object.assessment %> <%= render "linked_application_forms", teacher: application_form.teacher, email_used_as_reference_in_this_application_form: @view_object.email_used_as_reference_in_this_application_form?, other_application_forms_where_email_used_as_reference: @view_object.other_application_forms_where_email_used_as_reference %> -<% if @view_object.application_form.dqt_match.present? %> +<% if (duplicate_matches = @view_object.duplicate_matches).present? %> <%= govuk_notification_banner(title_text: "Important") do |notification_banner| %> - <% notification_banner.with_heading(text: "The application details match a record in DQT") %> + <% notification_banner.with_heading(text: "Application details match DQT record(s)") %> -
- DQT contains a matching record for the name and date of birth of this applicant. Teacher Reference Number: <%= @view_object.application_form.dqt_match["trn"] %>. -
+The surname and date of birth used in this application matches the following records found in the Database of Qualified Teachers (DQT):
+ +