feat: Add sidekiq jobs to monitor applied SLAs (#8828)
Fixes: https://linear.app/chatwoot/issue/CW-2983/sidekiq-jobservice-to-monitor-sla-breach Co-authored-by: Sojan <sojan@pepalo.com>
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
# Table name: applied_slas
|
||||
#
|
||||
# id :bigint not null, primary key
|
||||
# sla_status :string
|
||||
# sla_status :integer default("active")
|
||||
# created_at :datetime not null
|
||||
# updated_at :datetime not null
|
||||
# account_id :bigint not null
|
||||
@@ -20,4 +20,6 @@ class AppliedSla < ApplicationRecord
|
||||
belongs_to :account
|
||||
belongs_to :sla_policy
|
||||
belongs_to :conversation
|
||||
|
||||
enum sla_status: { active: 0, hit: 1, missed: 2 }
|
||||
end
|
||||
|
||||
@@ -3,6 +3,7 @@ module Enterprise::Concerns::Account
|
||||
|
||||
included do
|
||||
has_many :sla_policies, dependent: :destroy_async
|
||||
has_many :applied_slas, dependent: :destroy_async
|
||||
|
||||
def self.add_response_related_associations
|
||||
has_many :response_sources, dependent: :destroy_async
|
||||
|
||||
Reference in New Issue
Block a user