Skip to content

Commit

Permalink
[WIP] Trying to query veterans_organizations table
Browse files Browse the repository at this point in the history
  • Loading branch information
opticbob committed Oct 16, 2024
1 parent b1d8f2d commit fc3ec9e
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,12 @@ def create
private

def form_params
params.require(:pdf_generator2122).permit(
params_permitted.unshift(:organization_name)
)
params.require(:pdf_generator2122).permit(params_permitted)
end

def flatten_form_params
{
organization_name: form_params[:organization_name],
organization_name: form_params[:representative][:organization_name],
record_consent: form_params[:record_consent],
consent_limits: form_params[:consent_limits],
consent_address_change: form_params[:consent_address_change]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,6 @@ def form_params
)
end

def representative_params_permitted
[
:type,
:phone,
:email,
{ name: name_params_permitted,
address: address_params_permitted }
]
end

def flatten_form_params
{
record_consent: form_params[:record_consent],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ def params_permitted
{ consent_limits: [],
conditions_of_appointment: [],
claimant: claimant_params_permitted,
representative: representative_params_permitted,
veteran: veteran_params_permitted }
]
end
Expand All @@ -31,6 +32,17 @@ def claimant_params_permitted
]
end

def representative_params_permitted
[
:organization_name,
:type,
:phone,
:email,
{ name: name_params_permitted,
address: address_params_permitted }
]
end

def veteran_params_permitted
[
:ssn,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
RSpec.describe 'RepresentationManagement::V0::PdfGenerator2122', type: :request do
describe 'POST #create' do
let(:base_path) { '/representation_management/v0/pdf_generator2122' }
let(:organization) { create(:organization) }
let(:params) do
{
pdf_generator2122: {
organization_name: 'My Organization',
record_consent: '',
consent_address_change: '',
consent_limits: [],
Expand Down Expand Up @@ -55,6 +55,9 @@
zip_code: '98765',
zip_code_suffix: '4321'
}
},
representative: {
organization_name: organization.id
}
}
}
Expand Down

0 comments on commit fc3ec9e

Please sign in to comment.