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 contact urn on open room for wenichats #97

Merged
merged 1 commit into from
Dec 13, 2022
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
1 change: 1 addition & 0 deletions services/tickets/wenichats/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ type Contact struct {
Email string `json:"email,omitempty"`
Phone string `json:"phone,omitempty"`
CustomFields map[string]interface{} `json:"custom_fields,omitempty"`
URN string `json:"urn,omitempty"`
}

type RoomResponse struct {
Expand Down
1 change: 1 addition & 0 deletions services/tickets/wenichats/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ func (s *service) Open(session flows.Session, topic *flows.Topic, body string, a
roomData.Contact.Name = contact.Name()
roomData.SectorUUID = s.sectorUUID
roomData.QueueUUID = string(topic.UUID())
roomData.Contact.URN = session.Contact().PreferredURN().URN().String()

extra := &struct {
CustomFields map[string]interface{} `json:"custom_fields,omitempty"`
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
POST /v1/external/rooms/ HTTP/1.1
Host: chats-engine.dev.cloud.weni.ai
User-Agent: Go-http-client/1.1
Content-Length: 323
Content-Length: 393
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"},"custom_fields":{"activation_****************":"AACC55","age":"23","country":"brazil","gender":"Male","join_date":"2017-12-02","mood":"angry"}}
{"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"}}