Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add negative feedback to tipline's smooch request type #1820

Merged
merged 2 commits into from
Mar 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,7 @@
t.index ["user_id"], name: "index_project_media_users_on_user_id"
end

create_table "project_medias", force: :cascade do |t|
create_table "project_medias", id: :serial, force: :cascade do |t|
t.integer "project_id"
t.integer "media_id"
t.integer "user_id"
Expand Down Expand Up @@ -860,7 +860,8 @@
end

create_table "versions", id: :serial, force: :cascade do |t|
t.string "item_type", null: false
t.string "item_type"
t.string "{:null=>false}"
t.string "item_id", null: false
t.string "event", null: false
t.string "whodunnit"
Expand Down
6 changes: 5 additions & 1 deletion db/seeds.rb
Original file line number Diff line number Diff line change
Expand Up @@ -560,13 +560,17 @@ def create_tipline_user_and_data(project_media)
TiplineRequest.create!(
associated: project_media,
team_id: project_media.team_id,
smooch_request_type: ['default_requests', 'timeout_search_requests', 'relevant_search_result_requests'].sample,
smooch_request_type: smooch_request_type,
smooch_data: smooch_data,
smooch_report_received_at: [Time.now.to_i, nil].sample,
user_id: BotUser.smooch_user&.id
)
end

def smooch_request_type
['default_requests', 'timeout_search_requests', ['relevant_search_result_requests', 'irrelevant_search_result_requests']*3].flatten.sample
end

def create_tipline_requests(team_project_medias)
team_project_medias.each_with_index do |project_media, index|
if index.even?
Expand Down
Loading