feat: allow auto resolve waiting option (#11436)
This commit is contained in:
@@ -76,11 +76,16 @@ class Conversation < ApplicationRecord
|
||||
scope :assigned, -> { where.not(assignee_id: nil) }
|
||||
scope :assigned_to, ->(agent) { where(assignee_id: agent.id) }
|
||||
scope :unattended, -> { where(first_reply_created_at: nil).or(where.not(waiting_since: nil)) }
|
||||
scope :resolvable, lambda { |auto_resolve_after|
|
||||
scope :resolvable_not_waiting, lambda { |auto_resolve_after|
|
||||
return none if auto_resolve_after.to_i.zero?
|
||||
|
||||
open.where('last_activity_at < ? AND waiting_since IS NULL', Time.now.utc - auto_resolve_after.minutes)
|
||||
}
|
||||
scope :resolvable_all, lambda { |auto_resolve_after|
|
||||
return none if auto_resolve_after.to_i.zero?
|
||||
|
||||
open.where('last_activity_at < ?', Time.now.utc - auto_resolve_after.minutes)
|
||||
}
|
||||
|
||||
scope :last_user_message_at, lambda {
|
||||
joins(
|
||||
|
||||
Reference in New Issue
Block a user