diff --git a/app/controllers/v0/disability_compensation_forms_controller.rb b/app/controllers/v0/disability_compensation_forms_controller.rb index 09c0814e4e2..c0bdaa6b2e5 100644 --- a/app/controllers/v0/disability_compensation_forms_controller.rb +++ b/app/controllers/v0/disability_compensation_forms_controller.rb @@ -52,6 +52,9 @@ def suggested_conditions end def submit_all_claim + temp_separation_location_fix if Flipper.enabled?(:disability_compensation_temp_separation_location_code_string, + @current_user) + 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) @@ -172,5 +175,20 @@ 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 + if form_content.is_a?(Hash) && form_content['form526'].is_a?(Hash) + separation_location_code = form_content.dig('form526', 'serviceInformation', 'separationLocation') + unless separation_location_code.nil? + form_content['form526']['serviceInformation']['separationLocation']['separationLocationCode'] = + separation_location_code.to_s + end + end + end + # END TEMPORARY end end diff --git a/config/features.yml b/config/features.yml index fda615484b7..d82e67308ed 100644 --- a/config/features.yml +++ b/config/features.yml @@ -530,6 +530,9 @@ features: actor_type: user description: enables sending flashes to BGS for disability_compensation submissions. enable_in_development: true + disability_compensation_temp_separation_location_code_string: + actor_type: user + description: enables forcing separation location code to be a string in submit_all_claim endpoint. disability_compensation_form4142_supplemental: actor_type: user description: Use Lighthouse API to submit supplemental Form 21-4142 from Form 526EZ submissions