Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Api 34936 ptcpnt addrs create #16188

Merged
merged 22 commits into from
Apr 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
4325bd7
Initial commit
mchristiansonVA Mar 28, 2024
2afb256
Merge remote-tracking branch 'origin/master' into API-34936-ptcpnt-ad…
mchristiansonVA Mar 28, 2024
a3547b7
Merge remote-tracking branch 'origin/master' into API-34936-ptcpnt-ad…
mchristiansonVA Apr 1, 2024
1964bad
Merge remote-tracking branch 'origin/master' into API-34936-ptcpnt-ad…
mchristiansonVA Apr 2, 2024
2e27d84
Incremental commit, add spec test
mchristiansonVA Apr 2, 2024
1cf1879
Misc cleanup, spec value adjustments
mchristiansonVA Apr 3, 2024
de778e8
Add blank cassette for now
mchristiansonVA Apr 3, 2024
9420812
Test data tweaks
mchristiansonVA Apr 3, 2024
a83628f
Remove byebug
mchristiansonVA Apr 3, 2024
2cd73fa
Arrange options in order presented in BGS service catalog
mchristiansonVA Apr 4, 2024
b50cf2a
Add updated spec with accepted values, updated cassette
mchristiansonVA Apr 4, 2024
cbcae9e
Rubocop layout adjustment
mchristiansonVA Apr 4, 2024
3c28d26
Merge branch 'master' into API-34936-ptcpnt-addrs-create
mchristiansonVA Apr 4, 2024
e48b69f
Merge remote-tracking branch 'origin/master' into API-34936-ptcpnt-ad…
mchristiansonVA Apr 11, 2024
a05170f
Initial changes for BGS unit test pattern
mchristiansonVA Apr 11, 2024
9059626
Update to use helper method
mchristiansonVA Apr 11, 2024
0e36fb0
Merge branch 'master' into API-34936-ptcpnt-addrs-create
nihil2501 Apr 15, 2024
3a3b132
API-34936 correct outdated BGS client helper cassette location comment
nihil2501 Apr 15, 2024
0b36566
API-34936 move cassette location to match BGS client helper
nihil2501 Apr 15, 2024
96141bf
API-34936 replace hardcoded BGS base URL with cassette placeholder
nihil2501 Apr 15, 2024
7c70c31
API-34936 replace IP mismatch in BGS cassette
nihil2501 Apr 15, 2024
e12694c
API-34936 reformat vnp_ptcpnt_addrs_create cassette for readability
nihil2501 Apr 15, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions modules/claims_api/lib/bgs_service/vnp_ptcpnt_addrs_service.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# frozen_string_literal: true

module ClaimsApi
class VnpPtcpntAddrsService < ClaimsApi::LocalBGS
def vnp_ptcpnt_addrs_create(options)
arg_strg = convert_nil_values(options)
body = Nokogiri::XML::DocumentFragment.parse <<~EOXML
<arg0>
#{arg_strg}
</arg0>
EOXML

make_request(endpoint: 'VnpPtcpntAddrsWebServiceBean/VnpPtcpntAddrsService',
action: 'vnpPtcpntAddrsCreate', body:, key: 'return')
end
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
# frozen_string_literal: true

require 'rails_helper'
require 'bgs_service/vnp_ptcpnt_addrs_service'
require Rails.root.join('modules', 'claims_api', 'spec', 'support', 'bgs_client_helpers.rb')

metadata = {
bgs: {
service: 'vnp_ptcpnt_addrs_service',
operation: 'vnp_ptcpnt_addrs_create'
}
}

describe ClaimsApi::VnpPtcpntAddrsService, metadata do
subject { described_class.new external_uid: 'xUid', external_key: 'xKey' }

describe 'vnp_ptcpnt_addrs_create' do
let(:options) { {} }

it 'responds with attributes' do
options[:vnp_ptcpnt_addrs_id] = nil
options[:vnp_proc_id] = '3854596'
options[:vnp_ptcpnt_id] = '182057'
options[:efctv_dt] = '2020-07-16T18:20:18Z'
options[:addrs_one_txt] = '76 Crowther Ave'
options[:addrs_three_txt] = nil
options[:addrs_two_txt] = nil
options[:bad_addrs_ind] = nil
options[:city_nm] = 'Bridgeport'
options[:cntry_nm] = nil
options[:county_nm] = nil
options[:eft_waiver_type_nm] = nil
options[:email_addrs_txt] = '[email protected]'
options[:end_dt] = nil
options[:fms_addrs_code_txt] = nil
options[:frgn_postal_cd] = nil
options[:group_1_verifd_type_cd] = nil
options[:jrn_dt] = '2020-07-16T18:20:17Z'
options[:jrn_lctn_id] = 281
options[:jrn_obj_id] = 'VAgovAPI'
options[:jrn_status_type_cd] = 'U'
options[:jrn_user_id] = 'VAgovAPI'
options[:lctn_nm] = nil
options[:mlty_postal_type_cd] = nil
options[:mlty_post_office_type_cd] = nil
options[:postal_cd] = 'CT'
options[:prvnc_nm] = 'CT'
options[:ptcpnt_addrs_type_nm] = 'Mailing'
options[:shared_addrs_ind] = 'N'
options[:trsury_addrs_five_txt] = nil
options[:trsury_addrs_four_txt] = nil
options[:trsury_addrs_one_txt] = nil
options[:trsury_addrs_six_txt] = nil
options[:trsury_addrs_three_txt] = nil
options[:trsury_addrs_two_txt] = nil
options[:trsury_seq_nbr] = nil
options[:trtry_nm] = nil
options[:zip_first_suffix_nbr] = nil
options[:zip_prefix_nbr] = '06605'
options[:zip_second_suffix_nbr] = nil

use_bgs_cassette('happy_path') do
response = subject.vnp_ptcpnt_addrs_create(options)
expect(response).to include(
{ vnp_ptcpnt_addrs_id: '143950',
efctv_dt: '2020-07-16T18:20:18Z',
vnp_ptcpnt_id: '182057',
vnp_proc_id: '3854596',
addrs_one_txt: '76 Crowther Ave',
city_nm: 'Bridgeport',
email_addrs_txt: '[email protected]',
jrn_dt: '2020-07-16T18:20:17Z',
jrn_lctn_id: '281',
jrn_obj_id: 'VAgovAPI',
jrn_status_type_cd: 'U',
jrn_user_id: 'VAgovAPI',
postal_cd: 'CT',
prvnc_nm: 'CT',
ptcpnt_addrs_type_nm: 'Mailing',
shared_addrs_ind: 'N',
zip_prefix_nbr: '06605' }
)
end
end
end
end
2 changes: 1 addition & 1 deletion modules/claims_api/spec/support/bgs_client_helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ module BGSClientHelpers
# Then, HTTP interactions that occur within the block supplied to this method
# will be captured by VCR cassettes that have the following convenient
# properties:
# - They will be nicely organized at `bgs/:service/:operation/:name`
# - They will be nicely organized at `claims_api/bgs/:service/:operation/:name`
# - Cassette matching will be done on canonicalized XML bodies, so
# reformatting cassettes for human readability won't defeat matching
def use_bgs_cassette(name, &)
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading