Class: PartyProductInterestHandler

Inherits:
Object
  • Object
show all
Defined in:
app/subscribers/party_product_interest_handler.rb

Instance Method Summary collapse

Instance Method Details

#call(event) ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
# File 'app/subscribers/party_product_interest_handler.rb', line 4

def call(event)
  party = Party.find_by(id: event.data[:party_id])
  return unless party

  context = Campaign::DripContext.new(
    party:,
    product_line_ids_added: event.data[:product_line_ids_added],
    product_line_ids_removed: event.data[:product_line_ids_removed]
  )
  Campaign::AssignDripCampaigns.new.process(context)
end