Skip to content

Commit

Permalink
Updating Dependents Application Previous Marriage Info (#7931)
Browse files Browse the repository at this point in the history
* updating previous marriage info

* adding logging for claim id

* updating specs
  • Loading branch information
kathleencrawford authored Sep 21, 2021
1 parent c96e533 commit dba819e
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 4 deletions.
2 changes: 1 addition & 1 deletion app/models/bgs_dependents/marriage_history.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def format_info
divorce_country: @former_spouse.dig('end_location', 'country'),
divorce_state: @former_spouse.dig('end_location', 'state'),
divorce_city: @former_spouse.dig('end_location', 'city'),
marriage_termination_type_code: @former_spouse['reason_marriage_ended_other']
marriage_termination_type_code: @former_spouse['reason_marriage_ended']
}.merge(@former_spouse['full_name']).with_indifferent_access
end
end
Expand Down
5 changes: 4 additions & 1 deletion lib/bgs/form686c.rb
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,12 @@ def submit(payload)
end_product_code: @end_product_code
}
).create
benefit_claim_id = benefit_claim_record[:benefit_claim_id]
# temporary logging to troubleshoot
log_message_to_sentry("#{proc_id} - #{benefit_claim_id}", :warn, '', { team: 'vfs-ebenefits' })

vnp_benefit_claim.update(benefit_claim_record, vnp_benefit_claim_record)
prep_manual_claim(benefit_claim_record[:benefit_claim_id]) if vnp_proc_state_type_cd == 'MANUAL_VAGOV'
prep_manual_claim(benefit_claim_id) if vnp_proc_state_type_cd == 'MANUAL_VAGOV'
bgs_service.update_proc(proc_id, proc_state: @proc_state)
end
# rubocop:enable Metrics/MethodLength
Expand Down
15 changes: 14 additions & 1 deletion lib/bgs/marriages.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ def create_all

private

# rubocop:disable Metrics/MethodLength
def report_marriage_history(type)
@dependents_application[type].each do |former_spouse|
former_marriage = BGSDependents::MarriageHistory.new(former_spouse)
Expand All @@ -34,10 +35,22 @@ def report_marriage_history(type)
participant,
'Spouse',
'Ex-Spouse',
{ type: type }
{
type: type,
begin_date: marriage_info['start_date'],
marriage_country: marriage_info['marriage_country'],
marriage_state: marriage_info['marriage_state'],
marriage_city: marriage_info['marriage_city'],
divorce_state: marriage_info['divorce_state'],
divorce_city: marriage_info['divorce_city'],
divorce_country: marriage_info['divorce_country'],
end_date: marriage_info['end_date'],
marriage_termination_type_code: marriage_info['marriage_termination_type_code']
}
)
end
end
# rubocop:enable Metrics/MethodLength

def add_spouse
spouse = BGSDependents::Spouse.new(@dependents_application)
Expand Down
2 changes: 1 addition & 1 deletion spec/models/bgs_dependents/marriage_history_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
'divorce_state' => 'IL',
'divorce_city' => 'Chicago',
'divorce_country' => nil,
'marriage_termination_type_code' => 'Some other reason',
'marriage_termination_type_code' => 'Other',
'first' => 'Billy',
'middle' => 'Yohan',
'last' => 'Johnson',
Expand Down

0 comments on commit dba819e

Please sign in to comment.