diff --git a/app/controllers/concerns/idv/verify_info_concern.rb b/app/controllers/concerns/idv/verify_info_concern.rb index 6ea4ac57d5a..1108da94480 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], extra: { address_edited: !!idv_session.address_edited, address_line2_present: !pii[:address2].blank?, @@ -273,12 +274,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 71af0e13bb5..9f453c60677 100644 --- a/spec/controllers/idv/verify_info_controller_spec.rb +++ b/spec/controllers/idv/verify_info_controller_spec.rb @@ -389,6 +389,10 @@ }, ), ) + + 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 end diff --git a/spec/features/idv/analytics_spec.rb b/spec/features/idv/analytics_spec.rb index e622067b894..3c0abe3caa9 100644 --- a/spec/features/idv/analytics_spec.rb +++ b/spec/features/idv/analytics_spec.rb @@ -70,6 +70,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: {}, @@ -121,6 +125,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, @@ -144,7 +154,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, }, }, @@ -227,7 +237,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' => { @@ -347,7 +357,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' => { @@ -464,7 +474,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, @@ -701,7 +711,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' => {