Skip to content

Commit

Permalink
Use new_split_event
Browse files Browse the repository at this point in the history
  • Loading branch information
martha committed Feb 6, 2025
1 parent 38692ca commit c6f7c92
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions drivers/hmis/app/graphql/mutations/split_household.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,13 @@ def resolve(splitting_enrollment_inputs:)
donor_household.reload
donor_after_state = donor_household.snapshot_household_state

event = Hmis::HouseholdEvent.new
event.user = current_user
event.household = donor_household
event.event_type = Hmis::HouseholdEvent::SPLIT
event.event_details = {
'receiving_household_id': new_household_id,
'before': donor_before_state,
'after': donor_after_state,
}
event = Hmis::HouseholdEvent.new_split_event(
user: current_user,
household: donor_household,
receiving_household_id: new_household_id,
before_state: donor_before_state,
after_state: donor_after_state,
)
event.save!

# Invalidate remaining enrollments and trigger re-processing, since household composition has changed.
Expand Down

0 comments on commit c6f7c92

Please sign in to comment.