Restructure omni services and add Chatwoot research snapshot

This commit is contained in:
Ruslan Bakiev
2026-02-21 11:11:27 +07:00
parent edea7a0034
commit b73babbbf6
7732 changed files with 978203 additions and 32 deletions

View File

@@ -0,0 +1,30 @@
# frozen_string_literal: true
class Webhooks::Twitter
SUPPORTED_EVENTS = [:direct_message_events, :tweet_create_events].freeze
EDITABLE_ATTRS = [:tweets_enabled].freeze
attr_accessor :params, :account
def initialize(params)
@params = params
end
def consume
send(event_name) if event_name
end
private
def event_name
@event_name ||= SUPPORTED_EVENTS.find { |key| @params.key?(key.to_s) }
end
def direct_message_events
::Twitter::DirectMessageParserService.new(payload: @params).perform
end
def tweet_create_events
::Twitter::TweetParserService.new(payload: @params).perform
end
end