-
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.
Merge pull request #1280 from nyaruka/open_event_with_note
On second thoughts, better to just bundle the note with the open ticket event
- Loading branch information
Showing
7 changed files
with
25 additions
and
101 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 |
---|---|---|
|
@@ -120,12 +120,7 @@ | |
"email": "[email protected]", | ||
"name": "Bob" | ||
} | ||
} | ||
}, | ||
{ | ||
"type": "ticket_note_added", | ||
"created_on": "2018-10-18T14:20:30.000123456Z", | ||
"step_uuid": "59d74b86-3e2f-4a93-aece-b05d2fdcde0c", | ||
}, | ||
"note": "Last message: Hi everybody" | ||
}, | ||
{ | ||
|
@@ -234,12 +229,7 @@ | |
"uuid": "0d9a2c56-6fc2-4f27-93c5-a6322e26b740", | ||
"name": "General" | ||
} | ||
} | ||
}, | ||
{ | ||
"type": "ticket_note_added", | ||
"created_on": "2018-10-18T14:20:30.000123456Z", | ||
"step_uuid": "59d74b86-3e2f-4a93-aece-b05d2fdcde0c", | ||
}, | ||
"note": "Last message: Hi everybody" | ||
}, | ||
{ | ||
|
@@ -342,12 +332,7 @@ | |
"email": "[email protected]", | ||
"name": "Jim" | ||
} | ||
} | ||
}, | ||
{ | ||
"type": "ticket_note_added", | ||
"created_on": "2018-10-18T14:20:30.000123456Z", | ||
"step_uuid": "59d74b86-3e2f-4a93-aece-b05d2fdcde0c", | ||
}, | ||
"note": "Last message: Hi everybody" | ||
}, | ||
{ | ||
|
@@ -463,12 +448,7 @@ | |
"uuid": "472a7a73-96cb-4736-b567-056d987cc5b4", | ||
"name": "Weather" | ||
} | ||
} | ||
}, | ||
{ | ||
"type": "ticket_note_added", | ||
"created_on": "2018-10-18T14:20:30.000123456Z", | ||
"step_uuid": "59d74b86-3e2f-4a93-aece-b05d2fdcde0c", | ||
}, | ||
"note": "Last message: Hi everybody" | ||
}, | ||
{ | ||
|
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 |
---|---|---|
|
@@ -611,15 +611,7 @@ func TestEventMarshaling(t *testing.T) { | |
}`, | ||
}, | ||
{ | ||
events.NewTicketNoteAdded("this is weird"), | ||
`{ | ||
"type": "ticket_note_added", | ||
"created_on": "2018-10-18T14:20:30.000123456Z", | ||
"note": "this is weird" | ||
}`, | ||
}, | ||
{ | ||
events.NewTicketOpened(ticket), | ||
events.NewTicketOpened(ticket, "this is weird"), | ||
`{ | ||
"type": "ticket_opened", | ||
"created_on": "2018-10-18T14:20:30.000123456Z", | ||
|
@@ -633,7 +625,8 @@ func TestEventMarshaling(t *testing.T) { | |
"email": "[email protected]", | ||
"name": "Bob" | ||
} | ||
} | ||
}, | ||
"note": "this is weird" | ||
}`, | ||
}, | ||
} | ||
|
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -30,24 +30,27 @@ type Ticket struct { | |
// "name": "Weather" | ||
// }, | ||
// "assignee": {"email": "[email protected]", "name": "Bob"} | ||
// } | ||
// }, | ||
// "note": "this is weird" | ||
// } | ||
// | ||
// @event ticket_opened | ||
type TicketOpenedEvent struct { | ||
BaseEvent | ||
|
||
Ticket *Ticket `json:"ticket"` | ||
Note string `json:"note,omitempty"` | ||
} | ||
|
||
// NewTicketOpened returns a new ticket opened event | ||
func NewTicketOpened(ticket *flows.Ticket) *TicketOpenedEvent { | ||
func NewTicketOpened(ticket *flows.Ticket, note string) *TicketOpenedEvent { | ||
return &TicketOpenedEvent{ | ||
BaseEvent: NewBaseEvent(TypeTicketOpened), | ||
Ticket: &Ticket{ | ||
UUID: ticket.UUID(), | ||
Topic: ticket.Topic().Reference(), | ||
Assignee: ticket.Assignee().Reference(), | ||
}, | ||
Note: 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -52,11 +52,7 @@ | |
"email": "[email protected]", | ||
"name": "Bob" | ||
} | ||
} | ||
}, | ||
{ | ||
"type": "ticket_note_added", | ||
"created_on": "2018-10-18T14:20:30.000123456Z", | ||
}, | ||
"note": "this is a 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