feat: Add Public APIs for API Channel (#2375)

This commit is contained in:
Sojan Jose
2021-06-15 20:09:17 +05:30
committed by GitHub
parent 0f377da109
commit 853db60f8e
29 changed files with 404 additions and 11 deletions

View File

@@ -2,11 +2,19 @@
#
# Table name: channel_api
#
# id :bigint not null, primary key
# webhook_url :string
# created_at :datetime not null
# updated_at :datetime not null
# account_id :integer not null
# id :bigint not null, primary key
# hmac_mandatory :boolean default(FALSE)
# hmac_token :string
# identifier :string
# webhook_url :string
# created_at :datetime not null
# updated_at :datetime not null
# account_id :integer not null
#
# Indexes
#
# index_channel_api_on_hmac_token (hmac_token) UNIQUE
# index_channel_api_on_identifier (identifier) UNIQUE
#
class Channel::Api < ApplicationRecord
@@ -15,6 +23,9 @@ class Channel::Api < ApplicationRecord
validates :account_id, presence: true
belongs_to :account
has_secure_token :identifier
has_secure_token :hmac_token
has_one :inbox, as: :channel, dependent: :destroy
def name

View File

@@ -4,6 +4,7 @@
#
# id :integer not null, primary key
# feature_flags :integer default(3), not null
# hmac_mandatory :boolean default(FALSE)
# hmac_token :string
# pre_chat_form_enabled :boolean default(FALSE)
# pre_chat_form_options :jsonb