diff --git a/app/lib/trs/trn_request_params.rb b/app/lib/trs/trn_request_params.rb index 0f1ea4a5e..310b3c4e6 100644 --- a/app/lib/trs/trn_request_params.rb +++ b/app/lib/trs/trn_request_params.rb @@ -17,6 +17,8 @@ def call lastName: application_form.family_name, birthDate: application_form.date_of_birth.iso8601, emailAddress: teacher.email, + identityVerified: true, + oneLoginUserSubject: teacher.gov_one_id, address: { }, genderCode: "NotAvailable", diff --git a/spec/lib/trs/trn_request_params_spec.rb b/spec/lib/trs/trn_request_params_spec.rb index a43f6e767..4250c55dd 100644 --- a/spec/lib/trs/trn_request_params_spec.rb +++ b/spec/lib/trs/trn_request_params_spec.rb @@ -57,6 +57,8 @@ firstName: "Given", genderCode: "NotAvailable", inductionRequired: true, + identityVerified: true, + oneLoginUserSubject: nil, initialTeacherTraining: { ageRangeFrom: 7, ageRangeTo: 11, @@ -84,5 +86,51 @@ }, ) end + + context "when the teacher has a GOV.UK One Login ID" do + let(:teacher) do + create(:teacher, email: "teacher@example.com", gov_one_id: "12345678") + end + + it do + expect(subject).to eq( + { + address: { + }, + birthDate: "1960-01-01", + emailAddress: "teacher@example.com", + firstName: "Given", + genderCode: "NotAvailable", + inductionRequired: true, + identityVerified: true, + oneLoginUserSubject: "12345678", + initialTeacherTraining: { + ageRangeFrom: 7, + ageRangeTo: 11, + programmeStartDate: "1990-01-01", + programmeEndDate: "1995-01-01", + providerUkprn: nil, + subject1: "100425", + subject2: "100321", + subject3: nil, + trainingCountryCode: "FR", + }, + lastName: "Family", + middleName: nil, + qtsDate: "2024-01-07", + qualification: { + class: "NotKnown", + countryCode: "FR", + date: "1996-01-01", + heQualificationType: "Unknown", + providerUkprn: nil, + }, + recognitionRoute: "OverseasTrainedTeachers", + teacherType: "OverseasQualifiedTeacher", + underNewOverseasRegulations: true, + }, + ) + end + end end end