diff --git a/app/controllers/idv/agreement_controller.rb b/app/controllers/idv/agreement_controller.rb index 17786243597..7537ccc5c6d 100644 --- a/app/controllers/idv/agreement_controller.rb +++ b/app/controllers/idv/agreement_controller.rb @@ -37,6 +37,7 @@ def update if result.success? idv_session.idv_consent_given = true + idv_session.idv_consent_given_at = Time.zone.now if IdentityConfig.store.in_person_proofing_opt_in_enabled && IdentityConfig.store.in_person_proofing_enabled diff --git a/app/services/idv/session.rb b/app/services/idv/session.rb index ef69a96c023..9e76d23f2d6 100644 --- a/app/services/idv/session.rb +++ b/app/services/idv/session.rb @@ -13,6 +13,7 @@ class Session had_barcode_attention_error had_barcode_read_failure idv_consent_given + idv_consent_given_at idv_phone_step_document_capture_session_uuid mail_only_warning_shown opted_in_to_in_person_proofing diff --git a/spec/controllers/idv/agreement_controller_spec.rb b/spec/controllers/idv/agreement_controller_spec.rb index 1f090c22136..2eaced54ad0 100644 --- a/spec/controllers/idv/agreement_controller_spec.rb +++ b/spec/controllers/idv/agreement_controller_spec.rb @@ -161,6 +161,12 @@ expect(response).to redirect_to(idv_hybrid_handoff_url) end + + it 'sets an idv_consent_given_at timestamp' do + put :update, params: params + + expect(subject.idv_session.idv_consent_given_at).to be_within(3.seconds).of(Time.zone.now) + end end context 'when both ipp and opt-in ipp are enabled' do @@ -228,6 +234,13 @@ put :update, params: params expect(response).to render_template('idv/agreement/show') end + + it 'does not set IDV consent flags' do + put :update, params: params + + expect(subject.idv_session.idv_consent_given).to be_nil + expect(subject.idv_session.idv_consent_given_at).to be_nil + end end end end