Class: NewLead::CustomerProfileChangedHandler
- Inherits:
-
ApplicationJob
- Object
- ApplicationJob
- NewLead::CustomerProfileChangedHandler
- Includes:
- RailsEventStore::AsyncHandler
- Defined in:
- app/subscribers/new_lead/customer_profile_changed_handler.rb
Overview
Re-evaluates open lead activities after a customer's profile changes.
The event payload's profile IDs are intentionally not used for routing. An
older queued event may run after another profile correction, so the
reconciler always uses the freshly loaded customer's current profile.
Instance Method Summary collapse
Instance Method Details
#perform(event) ⇒ Object
13 14 15 16 17 18 |
# File 'app/subscribers/new_lead/customer_profile_changed_handler.rb', line 13 def perform(event) customer = Customer.find_by(id: event.data[:customer_id]) return unless customer NewLead::ActivityAgendaReconciler.call(customer:) end |