From 8632775fc98a7f42f8ff3b3c19703bdf7d553f0f Mon Sep 17 00:00:00 2001 From: Richard Lynch Date: Mon, 2 Sep 2024 17:13:05 +0100 Subject: [PATCH] Capture org and roles on verification When we create the verification record we want to also capture the organisation and roles as we'll be using the verification to create a DfeSignIn::User record which expects these fields. --- .../provider/verify_claim_form.rb | 4 +++- .../policies/further_education_payments/eligibilities.rb | 8 ++++++-- .../provider/verify_claim_form_spec.rb | 8 ++++++-- 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/app/forms/journeys/further_education_payments/provider/verify_claim_form.rb b/app/forms/journeys/further_education_payments/provider/verify_claim_form.rb index 9807230515..b0ee7ba205 100644 --- a/app/forms/journeys/further_education_payments/provider/verify_claim_form.rb +++ b/app/forms/journeys/further_education_payments/provider/verify_claim_form.rb @@ -99,7 +99,9 @@ def save dfe_sign_in_uid: answers.dfe_sign_in_uid, first_name: answers.dfe_sign_in_first_name, last_name: answers.dfe_sign_in_last_name, - email: answers.dfe_sign_in_email + email: answers.dfe_sign_in_email, + dfe_sign_in_organisation_name: answers.dfe_sign_in_organisation_name, + dfe_sign_in_role_codes: answers.dfe_sign_in_role_codes }, created_at: DateTime.now } diff --git a/spec/factories/policies/further_education_payments/eligibilities.rb b/spec/factories/policies/further_education_payments/eligibilities.rb index cb23d9b6c1..e663709ee4 100644 --- a/spec/factories/policies/further_education_payments/eligibilities.rb +++ b/spec/factories/policies/further_education_payments/eligibilities.rb @@ -53,7 +53,9 @@ "dfe_sign_in_uid" => "123", "first_name" => "Seymoure", "last_name" => "Skinner", - "email" => "seymore.skinner@springfield-elementary.edu" + "email" => "seymore.skinner@springfield-elementary.edu", + "dfe_sign_in_organisation_name" => "Springfield Elementary", + "dfe_sign_in_role_codes" => ["teacher_payments_claim_verifier"] }, "created_at" => "2024-01-01T12:00:00.000+00:00" } @@ -112,7 +114,9 @@ "dfe_sign_in_uid" => "123", "first_name" => "Seymoure", "last_name" => "Skinner", - "email" => "seymore.skinner@springfield-elementary.edu" + "email" => "seymore.skinner@springfield-elementary.edu", + "dfe_sign_in_organisation_name" => "Springfield Elementary", + "dfe_sign_in_role_codes" => ["teacher_payments_claim_verifier"] }, "created_at" => "2024-01-01T12:00:00.000+00:00" } diff --git a/spec/forms/journeys/further_education_payments/provider/verify_claim_form_spec.rb b/spec/forms/journeys/further_education_payments/provider/verify_claim_form_spec.rb index c7dd7c333e..90a70a65dd 100644 --- a/spec/forms/journeys/further_education_payments/provider/verify_claim_form_spec.rb +++ b/spec/forms/journeys/further_education_payments/provider/verify_claim_form_spec.rb @@ -38,7 +38,9 @@ dfe_sign_in_uid: "123", dfe_sign_in_first_name: "Seymoure", dfe_sign_in_last_name: "Skinner", - dfe_sign_in_email: "seymore.skinner@springfield-elementary.edu" + dfe_sign_in_email: "seymour.skinner@springfield-elementary.edu", + dfe_sign_in_organisation_name: "Springfield Elementary", + dfe_sign_in_role_codes: ["teacher_payments_claim_verifier"] } ) end @@ -302,7 +304,9 @@ "dfe_sign_in_uid" => "123", "first_name" => "Seymoure", "last_name" => "Skinner", - "email" => "seymore.skinner@springfield-elementary.edu" + "email" => "seymour.skinner@springfield-elementary.edu", + "dfe_sign_in_organisation_name" => "Springfield Elementary", + "dfe_sign_in_role_codes" => ["teacher_payments_claim_verifier"] }, "created_at" => "2024-01-01T12:00:00.000+00:00" }