diff --git a/modules/claims_api/lib/bgs_service/vnp_proc_form_service.rb b/modules/claims_api/lib/bgs_service/vnp_proc_form_service.rb new file mode 100644 index 00000000000..807af6c3047 --- /dev/null +++ b/modules/claims_api/lib/bgs_service/vnp_proc_form_service.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +module ClaimsApi + class VnpProcFormService < ClaimsApi::LocalBGS + FORM_TYPE_CD = '21-22' + + def vnp_proc_form_create(options) + vnp_proc_id = options[:vnp_proc_id] + options.delete(:vnp_proc_id) + arg_strg = convert_nil_values(options) + body = Nokogiri::XML::DocumentFragment.parse <<~EOXML + + + #{vnp_proc_id} + #{FORM_TYPE_CD} + + #{arg_strg} + + EOXML + + make_request(endpoint: 'VnpProcFormWebServiceBean/VnpProcFormService', + action: 'vnpProcFormCreate', body:, key: 'return') + end + end +end diff --git a/modules/claims_api/spec/lib/claims_api/vnp_proc_form_service_spec.rb b/modules/claims_api/spec/lib/claims_api/vnp_proc_form_service_spec.rb new file mode 100644 index 00000000000..d75344c9256 --- /dev/null +++ b/modules/claims_api/spec/lib/claims_api/vnp_proc_form_service_spec.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +require 'rails_helper' +require 'bgs_service/vnp_proc_form_service' + +describe ClaimsApi::VnpProcFormService do + subject { described_class.new external_uid: 'xUid', external_key: 'xKey' } + + describe 'vnp_proc_form_service' do + let(:options) { {} } + + it 'responds with a vnc_proc_id' do + options[:vnp_proc_id] = '3831394' + options[:vnp_ptcpnt_id] = nil + options[:jrn_dt] = nil + options[:jrn_obj_id] = 'VAgovAPI' + options[:jrn_status_type_cd] = 'U' + options[:jrn_user_id] = 'VAgovAPI' + VCR.use_cassette('bgs/vnp_proc_service_v2/vnp_proc_form_service') do + response = subject.vnp_proc_form_create(options) + expect(response[:comp_id][:vnp_proc_id]).to eq '3831394' + end + end + end +end diff --git a/spec/support/vcr_cassettes/bgs/vnp_proc_service_v2/vnp_proc_form_service.yml b/spec/support/vcr_cassettes/bgs/vnp_proc_service_v2/vnp_proc_form_service.yml new file mode 100644 index 00000000000..628c8e3c426 --- /dev/null +++ b/spec/support/vcr_cassettes/bgs/vnp_proc_service_v2/vnp_proc_form_service.yml @@ -0,0 +1,222 @@ +--- +http_interactions: +- request: + method: get + uri: https://internal-dsva-vagov-dev-fwdproxy-1893365470.us-gov-west-1.elb.amazonaws.com:4447/VnpProcFormWebServiceBean/VnpProcFormService?WSDL + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - Faraday v2.9.0 + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + response: + status: + code: 200 + message: OK + headers: + Date: + - Wed, 27 Mar 2024 18:49:03 GMT + Server: + - Apache + X-Frame-Options: + - SAMEORIGIN + Transfer-Encoding: + - chunked + Content-Type: + - text/xml;charset=utf-8 + Strict-Transport-Security: + - max-age=16000000; includeSubDomains; preload; + body: + encoding: UTF-8 + string: |- + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + recorded_at: Wed, 27 Mar 2024 18:49:03 GMT +- request: + method: post + uri: https://internal-dsva-vagov-dev-fwdproxy-1893365470.us-gov-west-1.elb.amazonaws.com:4447/VnpProcFormWebServiceBean/VnpProcFormService + body: + encoding: UTF-8 + string: | + + + + + + VAgovAPI + + + 192.168.0.9 + 281 + VAgovAPI + xUid + xKey + + + + + + + + + 3831394 + 21-22 + + VAgovAPIUVAgovAPI + + + + + + headers: + User-Agent: + - Faraday v2.9.0 + Content-Type: + - text/xml;charset=UTF-8 + Host: + - ".vba.va.gov" + Soapaction: + - '"vnpProcFormCreate"' + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + response: + status: + code: 200 + message: OK + headers: + Date: + - Wed, 27 Mar 2024 18:49:04 GMT + Server: + - Apache + X-Frame-Options: + - SAMEORIGIN + Transfer-Encoding: + - chunked + Content-Type: + - text/xml; charset=utf-8 + Strict-Transport-Security: + - max-age=16000000; includeSubDomains; preload; + body: + encoding: UTF-8 + string: rO0ABXdKABR3ZWJsb2dpYy5hcHAudm5wLWVhcgAAANYAAAAjd2VibG9naWMud29ya2FyZWEuU3RyaW5nV29ya0NvbnRleHQABTIuMC44AAA=383139421-22VAgovAPIUVAgovAPI + recorded_at: Wed, 27 Mar 2024 18:49:04 GMT +recorded_with: VCR 6.2.0