From e8e71b9e30f5e8b956dfbf20319950c380b6b424 Mon Sep 17 00:00:00 2001 From: Matt Wagner Date: Wed, 9 Oct 2024 10:58:46 -0400 Subject: [PATCH 1/3] LG-14653 | Log state_id_type on proofing result event changelog: Internal, Identity Proofing, Log state_id_type on doc auth verify proofing results event --- app/controllers/concerns/idv/verify_info_concern.rb | 3 +++ spec/controllers/idv/verify_info_controller_spec.rb | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/app/controllers/concerns/idv/verify_info_concern.rb b/app/controllers/concerns/idv/verify_info_concern.rb index 71c3a320cc9..01f338156a6 100644 --- a/app/controllers/concerns/idv/verify_info_concern.rb +++ b/app/controllers/concerns/idv/verify_info_concern.rb @@ -185,6 +185,7 @@ def async_state_done(current_async_state) state: pii[:state], state_id_jurisdiction: pii[:state_id_jurisdiction], state_id_number: pii[:state_id_number], + state_id_type: pii[:state_id_type], # todo: add other edited fields? extra: { address_edited: !!idv_session.address_edited, @@ -275,12 +276,14 @@ def idv_result_to_form_response( state: nil, state_id_jurisdiction: nil, state_id_number: nil, + state_id_type: nil, extra: {} ) state_id = result.dig(:context, :stages, :state_id) if state_id state_id[:state] = state if state state_id[:state_id_jurisdiction] = state_id_jurisdiction if state_id_jurisdiction + state_id[:state_id_type] = state_id_type if state_id_type if state_id_number state_id[:state_id_number] = StringRedacter.redact_alphanumeric(state_id_number) diff --git a/spec/controllers/idv/verify_info_controller_spec.rb b/spec/controllers/idv/verify_info_controller_spec.rb index f6aaf74bea4..ee6a69d064e 100644 --- a/spec/controllers/idv/verify_info_controller_spec.rb +++ b/spec/controllers/idv/verify_info_controller_spec.rb @@ -349,6 +349,10 @@ }, ), ) + + event = @analytics.events["IdV: doc auth verify proofing results"].first + state_id = event[:proofing_results][:context][:stages][:state_id] + expect(state_id).to match(a_hash_including(state_id_type: 'drivers_license')) end end From 6e6a0cc0d0a3b4475204d23af4fb3c7f9bfb1824 Mon Sep 17 00:00:00 2001 From: Matt Wagner Date: Wed, 9 Oct 2024 12:48:34 -0400 Subject: [PATCH 2/3] Update spec/controllers/idv/verify_info_controller_spec.rb Co-authored-by: Zach Margolis --- spec/controllers/idv/verify_info_controller_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/controllers/idv/verify_info_controller_spec.rb b/spec/controllers/idv/verify_info_controller_spec.rb index ee6a69d064e..e8aac79b618 100644 --- a/spec/controllers/idv/verify_info_controller_spec.rb +++ b/spec/controllers/idv/verify_info_controller_spec.rb @@ -351,7 +351,7 @@ ) event = @analytics.events["IdV: doc auth verify proofing results"].first - state_id = event[:proofing_results][:context][:stages][:state_id] + state_id = event.dig(:proofing_results, :context, :stages, :state_id) expect(state_id).to match(a_hash_including(state_id_type: 'drivers_license')) end end From 30be39eb649f4e0ca0a3a6dbd73da3f8e6fc4bbf Mon Sep 17 00:00:00 2001 From: Matt Wagner Date: Wed, 9 Oct 2024 17:56:23 -0400 Subject: [PATCH 3/3] Test fixes --- .../idv/verify_info_controller_spec.rb | 2 +- spec/features/idv/analytics_spec.rb | 20 ++++++++++++++----- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/spec/controllers/idv/verify_info_controller_spec.rb b/spec/controllers/idv/verify_info_controller_spec.rb index e8aac79b618..3f7e4d61dfe 100644 --- a/spec/controllers/idv/verify_info_controller_spec.rb +++ b/spec/controllers/idv/verify_info_controller_spec.rb @@ -350,7 +350,7 @@ ), ) - event = @analytics.events["IdV: doc auth verify proofing results"].first + event = @analytics.events['IdV: doc auth verify proofing results'].first state_id = event.dig(:proofing_results, :context, :stages, :state_id) expect(state_id).to match(a_hash_including(state_id_type: 'drivers_license')) end diff --git a/spec/features/idv/analytics_spec.rb b/spec/features/idv/analytics_spec.rb index 4c82b87b2c8..e5fed0a197f 100644 --- a/spec/features/idv/analytics_spec.rb +++ b/spec/features/idv/analytics_spec.rb @@ -71,6 +71,10 @@ jurisdiction_in_maintenance_window: false } end + let(:state_id_resolution_with_id_type) do + state_id_resolution.merge(state_id_type: 'drivers_license') + end + let(:resolution_block) do { success: true, errors: {}, @@ -122,6 +126,12 @@ } end + let(:doc_auth_verify_proofing_results) do + base_proofing_results.deep_merge( + context: { stages: { state_id: state_id_resolution_with_id_type } }, + ) + end + let(:in_person_path_proofing_results) do { exception: nil, @@ -145,7 +155,7 @@ vendor_name: 'ResolutionMock', vendor_workflow: nil, verified_attributes: nil }, - state_id: state_id_resolution, + state_id: state_id_resolution_with_id_type, threatmetrix: threatmetrix_response, }, }, @@ -228,7 +238,7 @@ ), 'IdV: doc auth verify proofing results' => { success: true, errors: {}, flow_path: 'standard', address_edited: false, address_line2_present: false, analytics_id: 'Doc Auth', step: 'verify', - proofing_results: base_proofing_results + proofing_results: doc_auth_verify_proofing_results }, 'IdV: phone of record visited' => { @@ -348,7 +358,7 @@ ), 'IdV: doc auth verify proofing results' => { success: true, errors: {}, flow_path: 'hybrid', address_edited: false, address_line2_present: false, analytics_id: 'Doc Auth', step: 'verify', - proofing_results: base_proofing_results + proofing_results: doc_auth_verify_proofing_results }, 'IdV: phone of record visited' => { @@ -465,7 +475,7 @@ ), 'IdV: doc auth verify proofing results' => { success: true, errors: {}, flow_path: 'standard', address_edited: false, address_line2_present: false, analytics_id: 'Doc Auth', step: 'verify', - proofing_results: base_proofing_results + proofing_results: doc_auth_verify_proofing_results }, 'IdV: phone of record visited' => { proofing_components: base_proofing_components, @@ -702,7 +712,7 @@ ), 'IdV: doc auth verify proofing results' => { success: true, errors: {}, flow_path: 'standard', address_edited: false, address_line2_present: false, analytics_id: 'Doc Auth', step: 'verify', - proofing_results: base_proofing_results + proofing_results: doc_auth_verify_proofing_results }, 'IdV: phone of record visited' => {