-
Notifications
You must be signed in to change notification settings - Fork 66
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds to the get_fault_info method in the soap_error_handler. Changes …
…the test url from dev to staging in test.yml. Adds vnp_ptcpnt_service and test, with cassette - WIP. Adds method in local_bgs to check for requreed params once we know what those are.
- Loading branch information
Showing
6 changed files
with
350 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# frozen_string_literal: true | ||
|
||
module ClaimsApi | ||
class VnpPtcpntService < ClaimsApi::LocalBGS | ||
# vnpPtcpntCreate - This service is used to create VONAPP participant information | ||
def vnp_ptcpnt_create(options) # rubocop:disable Metrics/MethodLength | ||
# validate_required_keys(vnp_ptcpnt_create_required_keys, options, __method__.to_s) | ||
options[:ptcpnt_type_nm] = 'Person' if options[:ptcpnt_type_nm].nil? | ||
body = Nokogiri::XML::DocumentFragment.parse <<~EOXML | ||
<arg0> | ||
<VnpProcDTO> | ||
<ptcpntTypeNm>#{options[:ptcpnt_type_nm]}</ptcpntTypeNm> | ||
<vnpPtcpntId>#{options[:vnp_ptcpnt_id]}</vnpPtcpntId> | ||
<vnpProcId>#{options[:vnp_proc_id]}</vnpProcId> | ||
<fraudInd>#{options[:fraud_ind]}</fraudInd> | ||
<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> | ||
<legacyPoaCd>#{options[:legacy_poa_cd]}</legacyPoaCd> | ||
<miscVendorInd>#{options[:misc_vendor_ind]}</miscVendorInd> | ||
<ptcpntShortNm>#{options[:ptcpnt_short_nm]}</ptcpntShortNm> | ||
<taxIdfctnNbr>#{options[:tax_idfctn_nbr]}</taxIdfctnNbr> | ||
<tinWaiverReasonTypeCd>#{options[:tin_waiver_reason_type_cd]}</tinWaiverReasonTypeCd> | ||
<ptcpntFkPtcpntId>#{options[:ptcpnt_fk_ptcpnt_id]}</ptcpntFkPtcpntId> | ||
<corpPtcpntId>#{options[:corp_ptcpnt_id]}</corpPtcpntId> | ||
</VnpProcDTO> | ||
</arg0> | ||
EOXML | ||
|
||
make_request(endpoint: 'VnpPtcpntWebServiceBean/VnpPtcpntService', action: 'vnpPtcpntCreate', body:, | ||
key: 'return') | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
modules/claims_api/spec/lib/claims_api/vnp_ptcpnt_service_spec.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# frozen_string_literal: true | ||
|
||
require 'rails_helper' | ||
require 'bgs_service/vnp_ptcpnt_service' | ||
|
||
describe ClaimsApi::VnpPtcpntService do | ||
subject { described_class.new external_uid: 'xUid', external_key: 'xKey' } | ||
|
||
describe 'vnp_ptcpnt_service' do | ||
let(:options) { {} } | ||
|
||
it 'responds with attributes' do | ||
options[:vnp_proc_id] = '3830249' # '3830252' # '3854437' | ||
# options[:vnp_ptcpnt_id] = nil | ||
# options[:fraud_ind] = nil | ||
# options[:jrn_dt] = nil | ||
# options[:jrn_lctn_id] = nil | ||
# options[:jrn_obj_id] = nil | ||
# options[:jrn_status_type_cd] = nil | ||
# options[:jrn_user_id] = nil | ||
# options[:legacy_poa_cd] = nil | ||
# options[:misc_vendor_ind] = nil | ||
# options[:ptcpnt_short_nm] = nil | ||
# options[:ptcpnt_type_nm] = nil | ||
# options[:tax_idfctn_nbr] = nil | ||
# options[:tin_waiver_reason_type_cd] = nil | ||
# options[:ptcpnt_fk_ptcpnt_id] = nil | ||
# options[:corp_ptcpnt_id] = nil | ||
VCR.use_cassette('bgs/vnp_proc_service_v2/vnp_ptcpnt_service') do | ||
response = subject.vnp_ptcpnt_create(options) | ||
expect(response).to include( | ||
{ | ||
vnp_bnft_claim_id: '426090', | ||
atchms_ind: 'N', | ||
bnft_claim_type_cd: '130DPNEBNADJ', | ||
ptcpnt_clmant_id: '150191', | ||
ptcpnt_mail_addrs_id: '116942', | ||
vnp_ptcpnt_vet_id: '150191', | ||
vnp_proc_id: '29637' | ||
} | ||
) | ||
end | ||
end | ||
end | ||
end |
259 changes: 259 additions & 0 deletions
259
spec/support/vcr_cassettes/bgs/vnp_proc_service_v2/vnp_ptcpnt_service.yml
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.