Skip to content

Commit

Permalink
add sensitivity level filter
Browse files Browse the repository at this point in the history
  • Loading branch information
tycol7 committed Nov 7, 2024
1 parent 9ca7e3e commit b4658c7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def index
service = ManageRepresentativeService.new(external_uid: 'power_of_attorney_request_uid',
external_key: 'power_of_attorney_request_key')

res = service.read_poa_request(poa_codes:, page_size:, page_index:)
res = service.read_poa_request(poa_codes:, page_size:, page_index:, filter:)

poa_list = res['poaRequestRespondReturnVOList']

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@ def bean_name
'VDC/ManageRepresentativeService'
end

def read_poa_request(poa_codes: [], page_size: nil, page_index: nil) # rubocop:disable Metrics/MethodLength
def read_poa_request(poa_codes: [], page_size: nil, page_index: nil, filter: nil) # rubocop:disable Metrics/MethodLength
# Workaround to allow multiple roots in the Nokogiri XML builder
# https://stackoverflow.com/a/4907450
doc = Nokogiri::XML::DocumentFragment.parse ''
sensitivity_level = filter['sensitivityLevel']

Nokogiri::XML::Builder.with(doc) do |xml|
xml.send('data:POACodeList') do
Expand All @@ -28,6 +29,11 @@ def read_poa_request(poa_codes: [], page_size: nil, page_index: nil) # rubocop:d
xml.pageIndex page_index if page_index
end
end
if sensitivity_level
xml.send('data:POARepSensitivityLevel') do
xml.text sensitivity_level
end
end
end

body = builder_to_xml(doc)
Expand Down

0 comments on commit b4658c7

Please sign in to comment.