diff --git a/services/tickets/wenichats/client.go b/services/tickets/wenichats/client.go index c727f859d..10f8f8523 100644 --- a/services/tickets/wenichats/client.go +++ b/services/tickets/wenichats/client.go @@ -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 { @@ -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 { diff --git a/services/tickets/wenichats/service.go b/services/tickets/wenichats/service.go index f439a93dd..56c8269e6 100644 --- a/services/tickets/wenichats/service.go +++ b/services/tickets/wenichats/service.go @@ -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"` diff --git a/services/tickets/wenichats/testdata/TestOpenAndForward_open_ticket.snap b/services/tickets/wenichats/testdata/TestOpenAndForward_open_ticket.snap index c27363879..4c0e5d2b2 100644 --- a/services/tickets/wenichats/testdata/TestOpenAndForward_open_ticket.snap +++ b/services/tickets/wenichats/testdata/TestOpenAndForward_open_ticket.snap @@ -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"}]} \ No newline at end of file +{"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"} \ No newline at end of file