Skip to content

Commit

Permalink
Maps direct deposit info for the pdf generator. (#12792)
Browse files Browse the repository at this point in the history
  • Loading branch information
stiehlrod authored May 31, 2023
1 parent eb4eada commit 8d6add6
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ def map_claim
service_info
disability_attributes
treatment_centers
direct_deposit_information

@pdf_data
end
Expand Down Expand Up @@ -287,6 +288,13 @@ def fed_activation

@pdf_data
end

def direct_deposit_information
@pdf_data[:data][:attributes][:directDepositInformation] = @pdf_data[:data][:attributes][:directDeposit]
@pdf_data[:data][:attributes].delete(:directDeposit)

@pdf_data
end
end
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -338,5 +338,28 @@
expect(served_after_nine_eleven).to eq(false)
end
end

context '526 section 8, direct deposot' do
let(:form_attributes) { auto_claim.dig('data', 'attributes') || {} }
let(:mapper) { ClaimsApi::V2::DisabilityCompensationPdfMapper.new(form_attributes, pdf_data) }

it 'maps the attributes correctly' do
mapper.map_claim

dir_deposit = pdf_data[:data][:attributes][:directDepositInformation]

account_type = dir_deposit[:accountType]
account_number = dir_deposit[:accountNumber]
routing_number = dir_deposit[:routingNumber]
financial_institution_name = dir_deposit[:financialInstitutionName]
no_account = dir_deposit[:noAccount]

expect(account_type).to eq('CHECKING')
expect(account_number).to eq('ABCDEF')
expect(routing_number).to eq('123123123')
expect(financial_institution_name).to eq('Some Bank')
expect(no_account).to eq(false)
end
end
end
end

0 comments on commit 8d6add6

Please sign in to comment.