feat: SLA CRUD APIs (EE) (#7027)

Fixes: https://linear.app/chatwoot/issue/CW-1613/sla-api

Co-authored-by: Sojan Jose <sojan@pepalo.com>
This commit is contained in:
Muhsin Keloth
2023-05-11 22:42:56 +05:30
committed by GitHub
parent c97d6021e0
commit 271263bcc2
19 changed files with 372 additions and 8 deletions

View File

@@ -0,0 +1,7 @@
module Enterprise::EnterpriseAccountConcern
extend ActiveSupport::Concern
included do
has_many :sla_policies, dependent: :destroy_async
end
end

View File

@@ -0,0 +1,21 @@
# == Schema Information
#
# Table name: sla_policies
#
# id :bigint not null, primary key
# frt_threshold :float
# name :string not null
# only_during_business_hours :boolean default(FALSE)
# rt_threshold :float
# created_at :datetime not null
# updated_at :datetime not null
# account_id :bigint not null
#
# Indexes
#
# index_sla_policies_on_account_id (account_id)
#
class SlaPolicy < ApplicationRecord
belongs_to :account
validates :name, presence: true
end