Skip to content

Commit

Permalink
Ticket CV2-5238: Expanding logic for calculating the responded_at a…
Browse files Browse the repository at this point in the history
…ttribute for tipline requests
  • Loading branch information
caiosba committed Sep 13, 2024
1 parent 088b49d commit 2b73b6c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/models/tipline_request.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ def returned_search_results?
end

def responded_at
self.returned_search_results? ? self.created_at.to_i : self.smooch_report_sent_at.to_i
report_sent_at = [self.smooch_report_received_at, self.smooch_report_update_received_at, self.smooch_report_sent_at, self.smooch_report_correction_sent_at].map(&:to_i).select{ |timestamp| timestamp > 0 }.min
self.returned_search_results? ? self.created_at.to_i : report_sent_at.to_i
end

def smooch_user_slack_channel_url
Expand Down

0 comments on commit 2b73b6c

Please sign in to comment.