diff --git a/app/services/proofing/aamva/proofer.rb b/app/services/proofing/aamva/proofer.rb index d5481d63cb6..c246c9219f3 100644 --- a/app/services/proofing/aamva/proofer.rb +++ b/app/services/proofing/aamva/proofer.rb @@ -58,11 +58,14 @@ def proof(applicant) applicant: aamva_applicant, ) - build_result_from_response(response, applicant[:state]) + build_result_from_response(response, applicant[:state_id_jurisdiction]) rescue => exception failed_result = Proofing::StateIdResult.new( success: false, errors: {}, exception: exception, vendor_name: 'aamva:state_id', - transaction_id: nil, verified_attributes: [] + transaction_id: nil, verified_attributes: [], + jurisdiction_in_maintenance_window: jurisdiction_in_maintenance_window?( + applicant[:state_id_jurisdiction], + ) ) send_to_new_relic(failed_result) failed_result diff --git a/spec/services/proofing/aamva/proofer_spec.rb b/spec/services/proofing/aamva/proofer_spec.rb index 0885a98d462..ad17e5c19e8 100644 --- a/spec/services/proofing/aamva/proofer_spec.rb +++ b/spec/services/proofing/aamva/proofer_spec.rb @@ -737,6 +737,18 @@ def self.test_not_successful expect(result.mva_timeout?).to eq(true) expect(result.mva_exception?).to eq(true) end + + context 'when the DMV is in a defined maintenance window' do + before do + expect(Idv::AamvaStateMaintenanceWindow).to receive(:in_maintenance_window?) + .and_return(true) + end + + it 'sets jurisdiction_in_maintenance_window to true' do + result = subject.proof(state_id_data) + expect(result.jurisdiction_in_maintenance_window?).to eq(true) + end + end end end