Skip to content

Commit

Permalink
Add new service, add spec & cassette
Browse files Browse the repository at this point in the history
  • Loading branch information
mchristiansonVA committed Mar 26, 2024
1 parent 137d71f commit 26b50b7
Show file tree
Hide file tree
Showing 3 changed files with 352 additions and 0 deletions.
28 changes: 28 additions & 0 deletions modules/claims_api/lib/bgs_service/vnp_proc_form_service.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# frozen_string_literal: true

module ClaimsApi
class VnpProcFormService < LocalBGS
FORM_TYPE_CD = '21-22'

def vnp_proc_form_create(options)
body = Nokogiri::XML::DocumentFragment.parse <<~EOXML
<arg0>
<VnpProcFormDTO>
<compId>
<vnpProcId>#{options[:vnp_proc_id]}</vnpProcId>
<formTypeCd>#{FORM_TYPE_CD}</formTypeCd>
</compId>
<jrnDt>#{options[:jrn_dt]}</jrnDt>
<jrnLctnId>#{options[:vnp_ptcpnt_id]}</jrnLctnId>
<jrnObjId>#{options[:jrn_obj_id]}</jrnObjId>
<jrnStatusTypeCd>#{options[:jrn_status_type_cd]}</jrnStatusTypeCd>
<jrnUserId>#{options[:jrn_user_id]}</jrnUserId>
</VnpProcFormDTO>
</arg0>
EOXML

make_request(endpoint: 'VnpProcFormWebServiceBean/VnpProcFormService',
action: 'vnpProcFormCreate', body:, key: 'return')
end
end
end

Check failure on line 28 in modules/claims_api/lib/bgs_service/vnp_proc_form_service.rb

View workflow job for this annotation

GitHub Actions / Linting and Security

Layout/TrailingEmptyLines: Final newline missing.
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# 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] = '3830252' # '3854437''3830249' #
# options[:vnp_ptcpnt_id] = nil
# options[:jrn_dt] = nil
# options[:jrn_obj_id] = nil
# options[:jrn_status_type_cd] = nil
# options[:jrn_user_id] = nil
VCR.use_cassette('bgs/vnp_proc_service_v2/vnp_proc_form_service') do
byebug

Check failure on line 20 in modules/claims_api/spec/lib/claims_api/vnp_proc_form_service_spec.rb

View workflow job for this annotation

GitHub Actions / Linting and Security

Lint/Debugger: Remove debugger entry point `byebug`.
response = subject.vnp_proc_form_create(options)
expect(response[:vnp_proc_id]).to eq '29637'
end
end
end
end

Check failure on line 26 in modules/claims_api/spec/lib/claims_api/vnp_proc_form_service_spec.rb

View workflow job for this annotation

GitHub Actions / Linting and Security

Layout/TrailingEmptyLines: Final newline missing.
Loading

0 comments on commit 26b50b7

Please sign in to comment.