feat: sort conversation on priority (#6943)

* feat: update seed script to include prioritt

* feat: add sort_handler for conversations

* test: sort on priority order

---------

Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com>
This commit is contained in:
Shivam Mishra
2023-04-25 09:47:47 +05:30
committed by GitHub
parent cf91e9eb58
commit 0bbb28c432
4 changed files with 47 additions and 6 deletions

View File

@@ -90,6 +90,7 @@ class Seeders::AccountSeeder
inbox: contact_inbox.inbox, assignee: assignee)
create_messages(conversation: conversation, messages: conversation_data['messages'])
conversation.update_labels(conversation_data[:labels]) if conversation_data[:labels].present?
conversation.update!(priority: conversation_data[:priority]) if conversation_data[:priority].present?
end
def create_messages(conversation:, messages:)

View File

@@ -308,6 +308,7 @@ contacts:
conversations:
- channel: Channel::Email
source_id: "mpetrukd@wunderground.test"
priority: urgent
messages:
- message_type: incoming
content: hello world
@@ -316,6 +317,7 @@ contacts:
gender: 'male'
conversations:
- channel: Channel::FacebookPage
priority: high
messages:
- message_type: incoming
content: "Hey there,I need some help with billing, my card is not working on the website."
@@ -324,6 +326,7 @@ contacts:
gender: 'female'
conversations:
- channel: Channel::WebWidget
priority: high
assignee: michael_scott@paperlayer.test
messages:
- message_type: incoming
@@ -333,6 +336,7 @@ contacts:
gender: 'female'
conversations:
- channel: Channel::Whatsapp
priority: high
source_id: "1223423567"
labels:
- billing
@@ -347,6 +351,7 @@ contacts:
gender: 'male'
conversations:
- channel: Channel::WebWidget
priority: medium
labels:
- software
- ops-handover
@@ -358,6 +363,7 @@ contacts:
gender: 'female'
conversations:
- channel: Channel::WebWidget
priority: low
assignee: michael_scott@paperlayer.test
labels:
- billing
@@ -371,6 +377,7 @@ contacts:
gender: 'female'
conversations:
- channel: Channel::Email
priority: urgent
source_id: "cmathersonj@va.test"
assignee: michael_scott@paperlayer.test
labels: