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:
Vishnu Narayanan
2024-02-07 23:14:56 +05:30
committed by GitHub
parent 98eddd0532
commit c1d07a5471
17 changed files with 371 additions and 29 deletions

View File

@@ -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

View File

@@ -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