forked from Ilhasoft/goflow
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'add-topic-queue_uuid' of https://github.com/weni-ai/goflow
- Loading branch information
Showing
21 changed files
with
87 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -127,7 +127,7 @@ func TestReferences(t *testing.T) { | |
// ticketer references must always be concrete | ||
assert.EqualError(t, utils.Validate(assets.NewTicketerReference("", "Booking")), "field 'uuid' is required") | ||
|
||
topicRef := assets.NewTopicReference("61602f3e-f603-4c70-8a8f-c477505bf4bf", "Weather") | ||
topicRef := assets.NewTopicReference("61602f3e-f603-4c70-8a8f-c477505bf4bf", "Weather", "") | ||
assert.Equal(t, "topic", topicRef.Type()) | ||
assert.Equal(t, "61602f3e-f603-4c70-8a8f-c477505bf4bf", topicRef.Identity()) | ||
assert.Equal(t, uuids.UUID("61602f3e-f603-4c70-8a8f-c477505bf4bf"), topicRef.GenericUUID()) | ||
|
@@ -136,7 +136,7 @@ func TestReferences(t *testing.T) { | |
assert.NoError(t, utils.Validate(topicRef)) | ||
|
||
// topic references must always be concrete | ||
assert.EqualError(t, utils.Validate(assets.NewTopicReference("", "Weather")), "field 'uuid' is required") | ||
assert.EqualError(t, utils.Validate(assets.NewTopicReference("", "Weather", "")), "field 'uuid' is required") | ||
|
||
userRef := assets.NewUserReference("[email protected]", "Bob") | ||
assert.Equal(t, "user", userRef.Type()) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -468,7 +468,7 @@ func TestConstructors(t *testing.T) { | |
actions.NewOpenTicket( | ||
actionUUID, | ||
assets.NewTicketerReference(assets.TicketerUUID("0baee364-07a7-4c93-9778-9f55a35903bb"), "Support Tickets"), | ||
assets.NewTopicReference("472a7a73-96cb-4736-b567-056d987cc5b4", "Weather"), | ||
assets.NewTopicReference("472a7a73-96cb-4736-b567-056d987cc5b4", "Weather", ""), | ||
"Where are my cookies?", | ||
assets.NewUserReference("[email protected]", "Bob McTickets"), | ||
"Ticket", | ||
|
@@ -482,6 +482,7 @@ func TestConstructors(t *testing.T) { | |
}, | ||
"topic": { | ||
"uuid": "472a7a73-96cb-4736-b567-056d987cc5b4", | ||
"queue_uuid": "", | ||
"name": "Weather" | ||
}, | ||
"body": "Where are my cookies?", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,7 +27,8 @@ const TypeOpenTicket string = "open_ticket" | |
// }, | ||
// "topic": { | ||
// "uuid": "472a7a73-96cb-4736-b567-056d987cc5b4", | ||
// "name": "Weather" | ||
// "name": "Weather", | ||
// "queue_uuid": "" | ||
// }, | ||
// "body": "@input", | ||
// "assignee": {"email": "[email protected]", "name": "Bob McTickets"}, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -389,15 +389,15 @@ | |
}, | ||
{ | ||
"template": "@(json(contact.tickets))", | ||
"output": "[{\"assignee\":null,\"body\":\"I have a problem\",\"topic\":null,\"uuid\":\"e5f5a9b0-1c08-4e56-8f5c-92e00bc3cf52\"},{\"assignee\":{\"email\":\"[email protected]\",\"first_name\":\"Bob\",\"name\":\"Bob\"},\"body\":\"What day is it?\",\"topic\":{\"name\":\"Weather\",\"uuid\":\"472a7a73-96cb-4736-b567-056d987cc5b4\"},\"uuid\":\"78d1fe0d-7e39-461e-81c3-a6a25f15ed69\"}]" | ||
"output": "[{\"assignee\":null,\"body\":\"I have a problem\",\"topic\":null,\"uuid\":\"e5f5a9b0-1c08-4e56-8f5c-92e00bc3cf52\"},{\"assignee\":{\"email\":\"[email protected]\",\"first_name\":\"Bob\",\"name\":\"Bob\"},\"body\":\"What day is it?\",\"topic\":{\"name\":\"Weather\",\"queue_uuid\":\"\",\"uuid\":\"472a7a73-96cb-4736-b567-056d987cc5b4\"},\"uuid\":\"78d1fe0d-7e39-461e-81c3-a6a25f15ed69\"}]" | ||
}, | ||
{ | ||
"template": "@ticket", | ||
"output": "{assignee: Bob, body: What day is it?, topic: Weather, uuid: 78d1fe0d-7e39-461e-81c3-a6a25f15ed69}" | ||
}, | ||
{ | ||
"template": "@(json(ticket))", | ||
"output": "{\"assignee\":{\"email\":\"[email protected]\",\"first_name\":\"Bob\",\"name\":\"Bob\"},\"body\":\"What day is it?\",\"topic\":{\"name\":\"Weather\",\"uuid\":\"472a7a73-96cb-4736-b567-056d987cc5b4\"},\"uuid\":\"78d1fe0d-7e39-461e-81c3-a6a25f15ed69\"}" | ||
"output": "{\"assignee\":{\"email\":\"[email protected]\",\"first_name\":\"Bob\",\"name\":\"Bob\"},\"body\":\"What day is it?\",\"topic\":{\"name\":\"Weather\",\"queue_uuid\":\"\",\"uuid\":\"472a7a73-96cb-4736-b567-056d987cc5b4\"},\"uuid\":\"78d1fe0d-7e39-461e-81c3-a6a25f15ed69\"}" | ||
}, | ||
{ | ||
"template": "@(json(contact))", | ||
|
@@ -447,6 +447,7 @@ | |
"body": "What day is it?", | ||
"topic": { | ||
"name": "Weather", | ||
"queue_uuid": "", | ||
"uuid": "472a7a73-96cb-4736-b567-056d987cc5b4" | ||
}, | ||
"uuid": "78d1fe0d-7e39-461e-81c3-a6a25f15ed69" | ||
|
@@ -533,6 +534,7 @@ | |
"body": "What day is it?", | ||
"topic": { | ||
"name": "Weather", | ||
"queue_uuid": "", | ||
"uuid": "472a7a73-96cb-4736-b567-056d987cc5b4" | ||
}, | ||
"uuid": "78d1fe0d-7e39-461e-81c3-a6a25f15ed69" | ||
|
@@ -758,6 +760,7 @@ | |
"body": "What day is it?", | ||
"topic": { | ||
"name": "Weather", | ||
"queue_uuid": "", | ||
"uuid": "472a7a73-96cb-4736-b567-056d987cc5b4" | ||
}, | ||
"uuid": "78d1fe0d-7e39-461e-81c3-a6a25f15ed69" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -46,7 +46,7 @@ func TestDependencies(t *testing.T) { | |
flows.NewExtractedReference(node1, action1, nil, envs.NilLanguage, assets.NewLabelReference("31c06b7c-010d-4f91-9590-d3fbdc2fb7ac", "Spam")), | ||
flows.NewExtractedReference(node1, action1, nil, envs.NilLanguage, assets.NewTemplateReference("ff958d30-f50e-48ab-a524-37ed1e9620d9", "Welcome")), | ||
flows.NewExtractedReference(node1, action1, nil, envs.NilLanguage, assets.NewTicketerReference("fb9cab80-4450-4a9d-ba9b-cb8df40dd233", "Support")), | ||
flows.NewExtractedReference(node1, action1, nil, envs.NilLanguage, assets.NewTopicReference("531d3fc7-64f4-4170-927d-b477e8145dd3", "Weather")), | ||
flows.NewExtractedReference(node1, action1, nil, envs.NilLanguage, assets.NewTopicReference("531d3fc7-64f4-4170-927d-b477e8145dd3", "Weather", "")), | ||
flows.NewExtractedReference(node1, action1, nil, envs.NilLanguage, assets.NewUserReference("[email protected]", "Jim")), | ||
flows.NewExtractedReference(node2, nil, router2, envs.NilLanguage, assets.NewGlobalReference("org_name", "Org Name")), | ||
} | ||
|
@@ -136,6 +136,7 @@ func TestDependencies(t *testing.T) { | |
"missing": true, | ||
"name": "Weather", | ||
"type": "topic", | ||
"queue_uuid": "", | ||
"uuid": "531d3fc7-64f4-4170-927d-b477e8145dd3" | ||
}, | ||
{ | ||
|
Oops, something went wrong.