Skip to content

Commit

Permalink
add update_benefit_claim to local bgs catalog
Browse files Browse the repository at this point in the history
  • Loading branch information
tycol7 committed Sep 24, 2024
1 parent 504cebc commit 8ac8582
Showing 1 changed file with 29 additions and 6 deletions.
35 changes: 29 additions & 6 deletions modules/claims_api/lib/bgs_service/benefit_claim_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,38 @@ def bean_name
end

def find_bnft_claim(claim_id:)
body = Nokogiri::XML::DocumentFragment.parse <<~EOXML
<bnftClaimId />
EOXML

{ bnftClaimId: claim_id }.each do |k, v|
body.xpath("./*[local-name()='#{k}']")[0].content = v
builder = Nokogiri::XML::Builder.new do
bnftClaimId claim_id
end

body = builder_to_xml(builder)

make_request(endpoint: bean_name, action: 'findBnftClaim', body:)
end

def update_benefit_claim(options = {})
builder = Nokogiri::XML::Builder.new do
benefitClaimUpdateInput do
fileNumber options[:file_number]
payeeCode options[:payee_code] || '00'
dateOfClaim options[:date_of_claim]
disposition options[:disposition] || 'M'
sectionUnitNo options[:section_unit_no]
folderWithClaim options[:folder_with_claim] || 'N'
claimantSsn options[:claimant_ssn]
powerOfAttorney options[:power_of_attorney]
benefitClaimType options[:benefit_claim_type]
oldEndProductCode options[:old_end_product_code]
newEndProductLabel options[:new_end_product_label]
oldDateOfClaim options[:old_date_of_claim]
allowPoaAccess options[:allow_poa_access]
allowPoaCadd options[:allow_poa_cadd]
end
end

body = builder_to_xml(builder)

make_request(endpoint: bean_name, action: 'updateBenefitClaim', body:)
end
end
end

0 comments on commit 8ac8582

Please sign in to comment.