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

Toxic Exposure: Add basic toxicExposure node to pre-submission JSON #16450

Merged
merged 11 commits into from
Apr 24, 2024
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ def translate
output_form.update(translate_veteran)
output_form.update(translate_treatments)
output_form.update(translate_disabilities)
output_form.update(add_toxic_exposure) if Flipper.enabled?(:disability_526_toxic_exposure, @current_user)

@translated_form
end
Expand Down Expand Up @@ -629,6 +630,14 @@ def map_secondary(input_disability, disabilities)
end
end

###
# Toxic Exposure
###

def add_toxic_exposure
{ 'toxicExposure' => input_form['toxicExposure'] }
end

def application_expiration_date
1.year.from_now.iso8601
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1451,6 +1451,36 @@
end
end

describe '#add_toxic_exposure' do
let(:form_content) do
{
'form526' => {
'toxicExposure' => {
'gulfWar1990' => {
'iraq' => true,
'kuwait' => true,
'qatar' => true
}
}
}
}
end

it 'returns toxic exposure' do
expect(subject.send(:add_toxic_exposure)).to eq(
{
'toxicExposure' => {
'gulfWar1990' => {
'iraq' => true,
'kuwait' => true,
'qatar' => true
}
}
}
)
end
end

describe '#application_expiration_date' do
it 'returns the application creation date + 365 days' do
expect(subject.send(:application_expiration_date)).to eq '2021-11-05T18:19:50Z'
Expand Down
2 changes: 2 additions & 0 deletions spec/requests/disability_compensation_form_request_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,8 @@ def test_error(cassette_path, status, headers)
post('/v0/disability_compensation_form/submit_all_claim', params: all_claims_form, headers:)
expect(response).to have_http_status(:ok)
expect(response).to match_response_schema('submit_disability_form')
form = Form526Submission.last.form
expect(form.dig('form526', 'form526', 'toxicExposure')).not_to eq(nil)
end

it 'matches the rated disabilites schema with camel-inflection' do
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@
]
}
],
"toxicExposure": {},
"waiveRetirementPay": false,
"waiveTrainingPay": true,
"hasTrainingPay": true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,69 @@
}
]
}
]
],
"toxicExposure": {
"gulfWar1990": {
"iraq": true,
"kuwait": true,
"qatar": true
},
"gulfWar1990Details": {
"iraq": {
"startDate": "1991-03-01",
"endDate": "1992-01-01"
},
"qatar": {
"startDate": "1991-02-12",
"endDate": "1991-06-01"
},
"kuwait": {
"startDate": "1991-03-15"
}
sethdarragile6 marked this conversation as resolved.
Show resolved Hide resolved
},
"herbicide": {
"cambodia": true,
"guam": true,
"laos": true
},
"herbicideDetails": {
"cambodia": {
"startDate": "1991-03-01",
"endDate": "1992-01-01"
},
"guam": {
"startDate": "1991-02-12",
"endDate": "1991-06-01"
},
"laos": {
"startDate": "1991-03-15"
}
},
"otherHerbicideLocations": "freeform text field.",
"otherExposures": {
"asbestos": true,
"radiation": true,
"mustardgas": false
},
"otherExposureDetails": {
"asbestos": {
"startDate": "1991-03-01",
"endDate": "1992-01-01"
},
"radiation": {
"startDate": "1991-03-01",
"endDate": "1992-01-01"
}
},
"specifyOtherExposures": {
"description": "Lead, burn pits",
"startDate": "1991-03-01",
"endDate": "1992-01-01"
},
"conditions": {
"deviatedseptum": true
}
}
}
},
"form526_uploads": [
Expand Down
Loading