-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replace ticket body with initial note
- Loading branch information
1 parent
8c99100
commit 2c6b97b
Showing
18 changed files
with
91 additions
and
99 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
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 |
---|---|---|
|
@@ -116,11 +116,11 @@ | |
"uuid": "472a7a73-96cb-4736-b567-056d987cc5b4", | ||
"name": "Weather" | ||
}, | ||
"body": "Last message: Hi everybody", | ||
"assignee": { | ||
"email": "[email protected]", | ||
"name": "Bob" | ||
} | ||
}, | ||
"note": "Last message: Hi everybody" | ||
} | ||
}, | ||
{ | ||
|
@@ -180,11 +180,11 @@ | |
"uuid": "472a7a73-96cb-4736-b567-056d987cc5b4", | ||
"name": "Weather" | ||
}, | ||
"body": "Last message: Hi everybody", | ||
"assignee": { | ||
"email": "[email protected]", | ||
"name": "Bob" | ||
} | ||
}, | ||
"note": "Last message: Hi everybody" | ||
} | ||
}, | ||
"templates": [ | ||
|
@@ -230,7 +230,7 @@ | |
"uuid": "0d9a2c56-6fc2-4f27-93c5-a6322e26b740", | ||
"name": "General" | ||
}, | ||
"body": "Last message: Hi everybody" | ||
"note": "Last message: Hi everybody" | ||
} | ||
}, | ||
{ | ||
|
@@ -290,7 +290,7 @@ | |
"uuid": "0d9a2c56-6fc2-4f27-93c5-a6322e26b740", | ||
"name": "General" | ||
}, | ||
"body": "Last message: Hi everybody" | ||
"note": "Last message: Hi everybody" | ||
} | ||
}, | ||
"templates": [ | ||
|
@@ -330,11 +330,11 @@ | |
"uuid": "472a7a73-96cb-4736-b567-056d987cc5b4", | ||
"name": "Weather" | ||
}, | ||
"body": "Last message: Hi everybody", | ||
"assignee": { | ||
"email": "[email protected]", | ||
"name": "Jim" | ||
} | ||
}, | ||
"note": "Last message: Hi everybody" | ||
} | ||
}, | ||
{ | ||
|
@@ -394,11 +394,11 @@ | |
"uuid": "472a7a73-96cb-4736-b567-056d987cc5b4", | ||
"name": "Weather" | ||
}, | ||
"body": "Last message: Hi everybody", | ||
"assignee": { | ||
"email": "[email protected]", | ||
"name": "Jim" | ||
} | ||
}, | ||
"note": "Last message: Hi everybody" | ||
} | ||
}, | ||
"templates": [ | ||
|
@@ -451,7 +451,7 @@ | |
"uuid": "472a7a73-96cb-4736-b567-056d987cc5b4", | ||
"name": "Weather" | ||
}, | ||
"body": "Last message: Hi everybody" | ||
"note": "Last message: Hi everybody" | ||
} | ||
}, | ||
{ | ||
|
@@ -511,7 +511,7 @@ | |
"uuid": "472a7a73-96cb-4736-b567-056d987cc5b4", | ||
"name": "Weather" | ||
}, | ||
"body": "Last message: Hi everybody" | ||
"note": "Last message: Hi everybody" | ||
} | ||
}, | ||
"templates": [ | ||
|
@@ -559,7 +559,7 @@ | |
"uuid": "0d9a2c56-6fc2-4f27-93c5-a6322e26b740", | ||
"name": "General" | ||
}, | ||
"body": "Where are my cookies? " | ||
"note": "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
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 |
---|---|---|
|
@@ -398,15 +398,15 @@ | |
}, | ||
{ | ||
"template": "@(json(contact.tickets))", | ||
"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\"},\"topic\":{\"name\":\"Weather\",\"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}" | ||
"output": "{assignee: Bob, 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\"},\"topic\":{\"name\":\"Weather\",\"uuid\":\"472a7a73-96cb-4736-b567-056d987cc5b4\"},\"uuid\":\"78d1fe0d-7e39-461e-81c3-a6a25f15ed69\"}" | ||
}, | ||
{ | ||
"template": "@(json(contact))", | ||
|
@@ -449,7 +449,6 @@ | |
"first_name": "Bob", | ||
"name": "Bob" | ||
}, | ||
"body": "What day is it?", | ||
"topic": { | ||
"name": "Weather", | ||
"uuid": "472a7a73-96cb-4736-b567-056d987cc5b4" | ||
|
@@ -529,7 +528,6 @@ | |
"first_name": "Bob", | ||
"name": "Bob" | ||
}, | ||
"body": "What day is it?", | ||
"topic": { | ||
"name": "Weather", | ||
"uuid": "472a7a73-96cb-4736-b567-056d987cc5b4" | ||
|
@@ -750,7 +748,6 @@ | |
"first_name": "Bob", | ||
"name": "Bob" | ||
}, | ||
"body": "What day is it?", | ||
"topic": { | ||
"name": "Weather", | ||
"uuid": "472a7a73-96cb-4736-b567-056d987cc5b4" | ||
|
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 |
---|---|---|
|
@@ -48,7 +48,7 @@ func TestEventMarshaling(t *testing.T) { | |
weather := session.Assets().Topics().Get("472a7a73-96cb-4736-b567-056d987cc5b4") | ||
user := session.Assets().Users().Get("[email protected]") | ||
facebook := session.Assets().Channels().Get("4bb288a0-7fca-4da1-abe8-59a593aff648") | ||
ticket := flows.NewTicket("7481888c-07dd-47dc-bf22-ef7448696ffe", weather, "Where are my cookies?", user) | ||
ticket := flows.NewTicket("7481888c-07dd-47dc-bf22-ef7448696ffe", weather, user, "this is weird") | ||
|
||
eventTests := []struct { | ||
event flows.Event | ||
|
@@ -309,16 +309,15 @@ func TestEventMarshaling(t *testing.T) { | |
"name": "Ryan Lewis", | ||
"status": "active", | ||
"ticket": { | ||
"assignee": { | ||
"email": "[email protected]", | ||
"name": "Bob" | ||
}, | ||
"body": "What day is it?", | ||
"uuid": "78d1fe0d-7e39-461e-81c3-a6a25f15ed69", | ||
"topic": { | ||
"uuid": "472a7a73-96cb-4736-b567-056d987cc5b4", | ||
"name": "Weather" | ||
}, | ||
"uuid": "78d1fe0d-7e39-461e-81c3-a6a25f15ed69" | ||
"assignee": { | ||
"email": "[email protected]", | ||
"name": "Bob" | ||
} | ||
}, | ||
"timezone": "America/Guayaquil", | ||
"urns": [ | ||
|
@@ -622,11 +621,11 @@ func TestEventMarshaling(t *testing.T) { | |
"uuid": "472a7a73-96cb-4736-b567-056d987cc5b4", | ||
"name": "Weather" | ||
}, | ||
"body": "Where are my cookies?", | ||
"assignee": { | ||
"email": "[email protected]", | ||
"name": "Bob" | ||
} | ||
}, | ||
"note": "this is weird" | ||
} | ||
}`, | ||
}, | ||
|
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 |
---|---|---|
|
@@ -15,8 +15,8 @@ const TypeTicketOpened string = "ticket_opened" | |
type Ticket struct { | ||
UUID flows.TicketUUID `json:"uuid" validate:"required,uuid4"` | ||
Topic *assets.TopicReference `json:"topic" validate:"omitempty"` | ||
Body string `json:"body"` | ||
Assignee *assets.UserReference `json:"assignee,omitempty" validate:"omitempty"` | ||
Note string `json:"note,omitempty"` | ||
} | ||
|
||
// TicketOpenedEvent events are created when a new ticket is opened. | ||
|
@@ -30,8 +30,8 @@ type Ticket struct { | |
// "uuid": "add17edf-0b6e-4311-bcd7-a64b2a459157", | ||
// "name": "Weather" | ||
// }, | ||
// "body": "Where are my cookies?", | ||
// "assignee": {"email": "[email protected]", "name": "Bob"} | ||
// "assignee": {"email": "[email protected]", "name": "Bob"}, | ||
// "note": "this is weird" | ||
// } | ||
// } | ||
// | ||
|
@@ -49,8 +49,8 @@ func NewTicketOpened(ticket *flows.Ticket) *TicketOpenedEvent { | |
Ticket: &Ticket{ | ||
UUID: ticket.UUID(), | ||
Topic: ticket.Topic().Reference(), | ||
Body: ticket.Body(), | ||
Assignee: ticket.Assignee().Reference(), | ||
Note: ticket.Note(), | ||
}, | ||
} | ||
} |
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 |
---|---|---|
|
@@ -14,11 +14,12 @@ | |
"uuid": "daa356b6-32af-44f0-9d35-6126d55ec3e9", | ||
"name": "Computers" | ||
}, | ||
"body": "Where are my keys?", | ||
"assignee": { | ||
"email": "[email protected]", | ||
"name": "Bob" | ||
} | ||
}, | ||
"note": "Where are my keys?", | ||
"body": "Where are my keys?" | ||
}, | ||
"contact_after": { | ||
"uuid": "5d76d86b-3bb9-4d5a-b822-c9d86f5d8e4f", | ||
|
@@ -31,11 +32,11 @@ | |
"uuid": "daa356b6-32af-44f0-9d35-6126d55ec3e9", | ||
"name": "Computers" | ||
}, | ||
"body": "Where are my keys?", | ||
"assignee": { | ||
"email": "[email protected]", | ||
"name": "Bob" | ||
} | ||
}, | ||
"note": "Where are my keys?" | ||
} | ||
}, | ||
"events": [ | ||
|
@@ -48,11 +49,11 @@ | |
"uuid": "daa356b6-32af-44f0-9d35-6126d55ec3e9", | ||
"name": "Computers" | ||
}, | ||
"body": "Where are my keys?", | ||
"assignee": { | ||
"email": "[email protected]", | ||
"name": "Bob" | ||
} | ||
}, | ||
"note": "Where are my keys?" | ||
} | ||
} | ||
] | ||
|
@@ -84,8 +85,9 @@ | |
"uuid": "daa356b6-32af-44f0-9d35-6126d55ec3e9", | ||
"name": "Computers" | ||
}, | ||
"body": "Should fail", | ||
"assignee": null | ||
"assignee": null, | ||
"note": "Should fail", | ||
"body": "Should fail" | ||
}, | ||
"contact_after": { | ||
"uuid": "5d76d86b-3bb9-4d5a-b822-c9d86f5d8e4f", | ||
|
@@ -98,7 +100,6 @@ | |
"uuid": "daa356b6-32af-44f0-9d35-6126d55ec3e9", | ||
"name": "Computers" | ||
}, | ||
"body": "Where are my keys?", | ||
"assignee": { | ||
"email": "[email protected]", | ||
"name": "Bob" | ||
|
Oops, something went wrong.