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,48 @@
# frozen_string_literal: true
FactoryBot.define do
factory :tweet_create_event, class: Hash do
for_user_id { '1' }
user_has_blocked { false }
tweet_create_events do
[
{
'created_at' => 'Wed Feb 05 08:39:31 +0000 2020',
'id' => 1,
'id_str' => '1',
'text' => '@chatwootapp Testing a sample tweet with Twitter client',
'source' => '<a href="http://twitter.com/download/iphone" rel="nofollow">Twitter for iPhone</a>',
'truncated' => false,
'in_reply_to_status_id' => nil,
'in_reply_to_status_id_str' => nil,
'in_reply_to_user_id' => 1,
'in_reply_to_user_id_str' => '1',
'in_reply_to_screen_name' => 'chatwootapp',
'user' => {
'id' => 2,
'name' => 'SurveyJoy',
'screen_name' => 'surveyjoyHQ',
'location' => 'Bangalore',
'url' => 'https://surveyjoy.co?utm_source=twitter',
'description' => 'Delightful in-product customer satisfaction surveys',
'followers_count' => 21,
'friends_count' => 13,
'profile_image_url' => 'http://pbs.twimg.com/profile_images/1114792399597985792/iHc5Gmez_normal.png',
'profile_image_url_https' => 'https://pbs.twimg.com/profile_images/1114792399597985792/iHc5Gmez_normal.png',
'profile_banner_url' => 'https://pbs.twimg.com/profile_banners/1109349707783041024/1554622013'
},
'geo' => nil,
'coordinates' => nil,
'place' => nil,
'contributors' => nil,
'is_quote_status' => false,
'quote_count' => 0,
'reply_count' => 0,
'retweet_count' => 0,
'favorite_count' => 0
}
]
end
initialize_with { attributes }
end
end

View File

@@ -0,0 +1,75 @@
# frozen_string_literal: true
FactoryBot.define do
factory :twitter_dm_image_event, class: Hash do
for_user_id { '1' }
direct_message_events do
[{
'type' => 'message_create',
'id' => '123',
'message_create' => {
'target' => { 'recipient_id' => '1' },
'sender_id' => '2',
'source_app_id' => '268278',
'message_data' => {
'text' => 'Blue Bird',
'attachment' => {
'media' => {
'display_url' => 'pic.twitter.com/5J1WJSRCy9',
'expanded_url' => 'https://twitter.com/nolan_test/status/930077847535812610/photo/1',
'id' => 9.300778475358126e17,
'id_str' => '930077847535812610',
'indices' => [
13,
36
],
'media_url' => 'http://pbs.twimg.com/media/DOhM30VVwAEpIHq.jpg',
'media_url_https' => 'https://pbs.twimg.com/media/DOhM30VVwAEpIHq.jpg',
'sizes' => {
'thumb' => {
'h' => 150,
'resize' => 'crop',
'w' => 150
},
'large' => {
'h' => 1366,
'resize' => 'fit',
'w' => 2048
},
'medium' => {
'h' => 800,
'resize' => 'fit',
'w' => 1200
},
'small' => {
'h' => 454,
'resize' => 'fit',
'w' => 680
}
},
'type' => 'photo',
'url' => 'https://t.co/5J1WJSRCy9'
}
}.with_indifferent_access
}
}
}.with_indifferent_access]
end
users do
{
'1' => {
id: '1',
name: 'person 1',
profile_image_url: 'https://chatwoot-assets.local/sample.png'
},
'2' => {
id: '1',
name: 'person 1',
profile_image_url: 'https://chatwoot-assets.local/sample.png'
}
}
end
initialize_with { attributes }
end
end

View File

@@ -0,0 +1,37 @@
# frozen_string_literal: true
FactoryBot.define do
factory :twitter_message_create_event, class: Hash do
for_user_id { '1' }
direct_message_events do
[{
'type' => 'message_create',
'id' => '123',
'message_create' => {
:target => { 'recipient_id' => '1' },
'sender_id' => '2',
'source_app_id' => '268278',
'message_data' => {
'text' => 'Blue Bird'
}
}
}]
end
users do
{
'1' => {
id: '1',
name: 'person 1',
profile_image_url: 'https://chatwoot-assets.local/sample.png'
},
'2' => {
id: '1',
name: 'person 1',
profile_image_url: 'https://chatwoot-assets.local/sample.png'
}
}
end
initialize_with { attributes }
end
end