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

dbex/97956-separation-location-string: temporary - turn separation loccation code into string for saved claim #19632

Merged
merged 9 commits into from
Nov 27, 2024
Merged
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions app/controllers/v0/disability_compensation_forms_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ def suggested_conditions
end

def submit_all_claim
temp_separation_location_fix

saved_claim = SavedClaim::DisabilityCompensation::Form526AllClaim.from_hash(form_content)
saved_claim.save ? log_success(saved_claim) : log_failure(saved_claim)
submission = create_submission(saved_claim)
Expand Down Expand Up @@ -172,5 +174,27 @@ def missing_disabilities?(submission)
end
false
end

# TEMPORARY
# Turn separation location into string
# 11/18/2024 BRD EVSS -> Lighthouse migration caused separation location to turn into an integer,
# while SavedClaim (vets-json-schema) is expecting a string
def temp_separation_location_fix
unless form_content.is_a?(Hash) &&
form_content['form526'].present? &&
form_content['form526']['serviceInformation'].present?
return
end

separation_location = form_content['form526']['serviceInformation']['separationLocation']

return if separation_location.blank?

separation_location_code =
separation_location['separationLocationCode'].to_s
separation_location['separationLocationCode'] =
separation_location_code
end
# END TEMPORARY
end
end
Loading