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

wenichats integration tweak contact groups #114

Merged
merged 1 commit into from
Jan 31, 2023
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
2 changes: 1 addition & 1 deletion services/tickets/wenichats/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,6 @@ type RoomRequest struct {
CustomFields map[string]interface{} `json:"custom_fields,omitempty"`
CallbackURL string `json:"callback_url,omitempty"`
FlowUUID assets.FlowUUID `json:"flow_uuid,omitempty"`
Groups []Group `json:"groups,omitempty"`
}

type Contact struct {
Expand All @@ -165,6 +164,7 @@ type Contact struct {
Phone string `json:"phone,omitempty"`
CustomFields map[string]interface{} `json:"custom_fields,omitempty"`
URN string `json:"urn,omitempty"`
Groups []Group `json:"groups,omitempty"`
}

type RoomResponse struct {
Expand Down
2 changes: 1 addition & 1 deletion services/tickets/wenichats/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ func (s *service) Open(session flows.Session, topic *flows.Topic, body string, a
roomData.QueueUUID = string(topic.UUID())
roomData.Contact.URN = session.Contact().PreferredURN().URN().String()
roomData.FlowUUID = session.Runs()[0].Flow().UUID()
roomData.Groups = groups
roomData.Contact.Groups = groups

extra := &struct {
CustomFields map[string]interface{} `json:"custom_fields,omitempty"`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ Authorization: Bearer ****************
Content-Type: application/json
Accept-Encoding: gzip

{"queue_uuid":"ffc903f7-8cbb-443f-9627-87106842d1aa","sector_uuid":"1a4bae05-993c-4f3b-91b5-80f4e09951f2","contact":{"external_id":"5d76d86b-3bb9-4d5a-b822-c9d86f5d8e4f","name":"Ryan Lewis","urn":"tel:+12024561111?channel=57f1078f-88aa-46f4-a59a-948a5739c03d"},"custom_fields":{"activation_****************":"AACC55","age":"23","country":"brazil","gender":"Male","join_date":"2017-12-02","mood":"angry"},"flow_uuid":"50c3706e-fedb-42c0-8eab-dda3335714b7","groups":[{"uuid":"b7cf0d83-f1c9-411c-96fd-c511a4cfa86d","name":"Testers"},{"uuid":"4f1f98fc-27a7-4a69-bbdb-24744ba739a9","name":"Males"}]}
{"queue_uuid":"ffc903f7-8cbb-443f-9627-87106842d1aa","sector_uuid":"1a4bae05-993c-4f3b-91b5-80f4e09951f2","contact":{"external_id":"5d76d86b-3bb9-4d5a-b822-c9d86f5d8e4f","name":"Ryan Lewis","urn":"tel:+12024561111?channel=57f1078f-88aa-46f4-a59a-948a5739c03d","groups":[{"uuid":"b7cf0d83-f1c9-411c-96fd-c511a4cfa86d","name":"Testers"},{"uuid":"4f1f98fc-27a7-4a69-bbdb-24744ba739a9","name":"Males"}]},"custom_fields":{"activation_****************":"AACC55","age":"23","country":"brazil","gender":"Male","join_date":"2017-12-02","mood":"angry"},"flow_uuid":"50c3706e-fedb-42c0-8eab-dda3335714b7"}