feat: Conversation API to return applied_sla and sla_events (#9174)

* chore: Add sla_events to push_event_data

* chore: Return SLA details in the API

* chore: feature lock sla push event data

* Update _conversation.json.jbuilder

* chore: rubocop fixes
This commit is contained in:
Sojan Jose
2024-04-01 23:30:07 +05:30
committed by GitHub
parent 16282f6a66
commit 4e28481f27
20 changed files with 198 additions and 13 deletions

View File

@@ -31,9 +31,18 @@ class SlaEvent < ApplicationRecord
enum event_type: { frt: 0, nrt: 1, rt: 2 }
before_validation :ensure_applied_sla_id, :ensure_account_id, :ensure_inbox_id, :ensure_sla_policy_id
after_create_commit :create_notifications
def push_event_data
{
id: id,
event_type: event_type,
meta: meta,
created_at: created_at.to_i,
updated_at: updated_at.to_i
}
end
private
def ensure_applied_sla_id