Skip to content

Commit

Permalink
Add endpoint to change ticket topic
Browse files Browse the repository at this point in the history
  • Loading branch information
rowanseymour committed Aug 26, 2021
1 parent 1acf150 commit f888455
Show file tree
Hide file tree
Showing 21 changed files with 282 additions and 89 deletions.
1 change: 1 addition & 0 deletions core/models/contacts.go
Original file line number Diff line number Diff line change
Expand Up @@ -536,6 +536,7 @@ LEFT JOIN (
'body', t.body,
'external_id', t.external_id,
'ticketer_id', t.ticketer_id,
'topic_id', t.topic_id,
'assignee_id', t.assignee_id
) ORDER BY t.opened_on ASC, t.id ASC
) as tickets
Expand Down
8 changes: 5 additions & 3 deletions core/models/contacts_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ func TestContacts(t *testing.T) {
defer testsuite.Reset()

testdata.InsertContactURN(db, testdata.Org1, testdata.Bob, "whatsapp:250788373373", 999)
testdata.InsertOpenTicket(db, testdata.Org1, testdata.Cathy, testdata.Zendesk, "Problem!", "Where are my shoes?", "1234", testdata.Agent)
testdata.InsertOpenTicket(db, testdata.Org1, testdata.Cathy, testdata.Zendesk, "Another Problem!", "Where are my pants?", "2345", nil)
testdata.InsertOpenTicket(db, testdata.Org1, testdata.Bob, testdata.Mailgun, "Urgent", "His name is Bob", "", testdata.Editor)
testdata.InsertOpenTicket(db, testdata.Org1, testdata.Cathy, testdata.Zendesk, testdata.SupportTopic, "Problem!", "Where are my shoes?", "1234", testdata.Agent)
testdata.InsertOpenTicket(db, testdata.Org1, testdata.Cathy, testdata.Zendesk, testdata.SalesTopic, "Another Problem!", "Where are my pants?", "2345", nil)
testdata.InsertOpenTicket(db, testdata.Org1, testdata.Bob, testdata.Mailgun, testdata.DefaultTopic, "Urgent", "His name is Bob", "", testdata.Editor)

// delete mailgun ticketer
db.MustExec(`UPDATE tickets_ticketer SET is_active = false WHERE id = $1`, testdata.Mailgun.ID)
Expand Down Expand Up @@ -64,8 +64,10 @@ func TestContacts(t *testing.T) {

cathyTickets := cathy.Tickets().All()
assert.Equal(t, "Problem!", cathyTickets[0].Subject())
assert.Equal(t, "Support", cathyTickets[0].Topic().Name())
assert.Equal(t, "agent1@nyaruka.com", cathyTickets[0].Assignee().Email())
assert.Equal(t, "Another Problem!", cathyTickets[1].Subject())
assert.Equal(t, "Sales", cathyTickets[1].Topic().Name())
assert.Nil(t, cathyTickets[1].Assignee())

assert.Equal(t, "Yobe", cathy.Fields()["state"].QueryValue())
Expand Down
2 changes: 1 addition & 1 deletion core/models/msgs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ func TestNonPersistentBroadcasts(t *testing.T) {
db.MustExec(`DELETE FROM tickets_ticket`)
}()

ticket := testdata.InsertOpenTicket(db, testdata.Org1, testdata.Bob, testdata.Mailgun, "Problem", "", "", nil)
ticket := testdata.InsertOpenTicket(db, testdata.Org1, testdata.Bob, testdata.Mailgun, testdata.DefaultTopic, "Problem", "", "", nil)
modelTicket := ticket.Load(db)

translations := map[envs.Language]*models.BroadcastTranslation{envs.Language("eng"): {Text: "Hi there"}}
Expand Down
36 changes: 22 additions & 14 deletions core/models/ticket_events.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,12 @@ type TicketEventID int
type TicketEventType string

const (
TicketEventTypeOpened TicketEventType = "O"
TicketEventTypeAssigned TicketEventType = "A"
TicketEventTypeNote TicketEventType = "N"
TicketEventTypeClosed TicketEventType = "C"
TicketEventTypeReopened TicketEventType = "R"
TicketEventTypeOpened TicketEventType = "O"
TicketEventTypeAssigned TicketEventType = "A"
TicketEventTypeNoteAdded TicketEventType = "N"
TicketEventTypeTopicChanged TicketEventType = "T"
TicketEventTypeClosed TicketEventType = "C"
TicketEventTypeReopened TicketEventType = "R"
)

type TicketEvent struct {
Expand All @@ -28,40 +29,46 @@ type TicketEvent struct {
TicketID TicketID `json:"ticket_id" db:"ticket_id"`
EventType TicketEventType `json:"event_type" db:"event_type"`
Note null.String `json:"note,omitempty" db:"note"`
TopicID TopicID `json:"topic_id,omitempty" db:"topic_id"`
AssigneeID UserID `json:"assignee_id,omitempty" db:"assignee_id"`
CreatedByID UserID `json:"created_by_id,omitempty" db:"created_by_id"`
CreatedOn time.Time `json:"created_on" db:"created_on"`
}
}

func NewTicketOpenedEvent(t *Ticket, userID UserID, assigneeID UserID) *TicketEvent {
return newTicketEvent(t, userID, TicketEventTypeOpened, "", assigneeID)
return newTicketEvent(t, userID, TicketEventTypeOpened, "", NilTopicID, assigneeID)
}

func NewTicketAssignedEvent(t *Ticket, userID UserID, assigneeID UserID, note string) *TicketEvent {
return newTicketEvent(t, userID, TicketEventTypeAssigned, note, assigneeID)
return newTicketEvent(t, userID, TicketEventTypeAssigned, note, NilTopicID, assigneeID)
}

func NewTicketNoteEvent(t *Ticket, userID UserID, note string) *TicketEvent {
return newTicketEvent(t, userID, TicketEventTypeNote, note, NilUserID)
func NewTicketNoteAddedEvent(t *Ticket, userID UserID, note string) *TicketEvent {
return newTicketEvent(t, userID, TicketEventTypeNoteAdded, note, NilTopicID, NilUserID)
}

func NewTicketTopicChangedEvent(t *Ticket, userID UserID, topicID TopicID) *TicketEvent {
return newTicketEvent(t, userID, TicketEventTypeTopicChanged, "", topicID, NilUserID)
}

func NewTicketClosedEvent(t *Ticket, userID UserID) *TicketEvent {
return newTicketEvent(t, userID, TicketEventTypeClosed, "", NilUserID)
return newTicketEvent(t, userID, TicketEventTypeClosed, "", NilTopicID, NilUserID)
}

func NewTicketReopenedEvent(t *Ticket, userID UserID) *TicketEvent {
return newTicketEvent(t, userID, TicketEventTypeReopened, "", NilUserID)
return newTicketEvent(t, userID, TicketEventTypeReopened, "", NilTopicID, NilUserID)
}

func newTicketEvent(t *Ticket, userID UserID, eventType TicketEventType, note string, assigneeID UserID) *TicketEvent {
func newTicketEvent(t *Ticket, userID UserID, eventType TicketEventType, note string, topicID TopicID, assigneeID UserID) *TicketEvent {
event := &TicketEvent{}
e := &event.e
e.OrgID = t.OrgID()
e.ContactID = t.ContactID()
e.TicketID = t.ID()
e.EventType = eventType
e.Note = null.String(note)
e.TopicID = topicID
e.AssigneeID = assigneeID
e.CreatedOn = dates.Now()
e.CreatedByID = userID
Expand All @@ -74,6 +81,7 @@ func (e *TicketEvent) ContactID() ContactID { return e.e.ContactID }
func (e *TicketEvent) TicketID() TicketID { return e.e.TicketID }
func (e *TicketEvent) EventType() TicketEventType { return e.e.EventType }
func (e *TicketEvent) Note() null.String { return e.e.Note }
func (e *TicketEvent) TopicID() TopicID { return e.e.TopicID }
func (e *TicketEvent) AssigneeID() UserID { return e.e.AssigneeID }
func (e *TicketEvent) CreatedByID() UserID { return e.e.CreatedByID }

Expand All @@ -89,8 +97,8 @@ func (e *TicketEvent) UnmarshalJSON(b []byte) error {

const insertTicketEventsSQL = `
INSERT INTO
tickets_ticketevent(org_id, contact_id, ticket_id, event_type, note, assignee_id, created_on, created_by_id)
VALUES(:org_id, :contact_id, :ticket_id, :event_type, :note, :assignee_id, :created_on, :created_by_id)
tickets_ticketevent(org_id, contact_id, ticket_id, event_type, note, topic_id, assignee_id, created_on, created_by_id)
VALUES(:org_id, :contact_id, :ticket_id, :event_type, :note, :topic_id, :assignee_id, :created_on, :created_by_id)
RETURNING
id
`
Expand Down
11 changes: 8 additions & 3 deletions core/models/ticket_events_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ func TestTicketEvents(t *testing.T) {
db.MustExec(`DELETE FROM tickets_ticket`)
}()

ticket := testdata.InsertOpenTicket(db, testdata.Org1, testdata.Cathy, testdata.Mailgun, "Need help", "Have you seen my cookies?", "17", nil)
ticket := testdata.InsertOpenTicket(db, testdata.Org1, testdata.Cathy, testdata.Mailgun, testdata.DefaultTopic, "Need help", "Have you seen my cookies?", "17", nil)
modelTicket := ticket.Load(db)

e1 := models.NewTicketOpenedEvent(modelTicket, testdata.Admin.ID, testdata.Agent.ID)
Expand All @@ -36,8 +36,8 @@ func TestTicketEvents(t *testing.T) {
assert.Equal(t, null.String("please handle"), e2.Note())
assert.Equal(t, testdata.Admin.ID, e2.CreatedByID())

e3 := models.NewTicketNoteEvent(modelTicket, testdata.Agent.ID, "please handle")
assert.Equal(t, models.TicketEventTypeNote, e3.EventType())
e3 := models.NewTicketNoteAddedEvent(modelTicket, testdata.Agent.ID, "please handle")
assert.Equal(t, models.TicketEventTypeNoteAdded, e3.EventType())
assert.Equal(t, null.String("please handle"), e3.Note())
assert.Equal(t, testdata.Agent.ID, e3.CreatedByID())

Expand All @@ -49,6 +49,11 @@ func TestTicketEvents(t *testing.T) {
assert.Equal(t, models.TicketEventTypeReopened, e5.EventType())
assert.Equal(t, testdata.Editor.ID, e5.CreatedByID())

e6 := models.NewTicketTopicChangedEvent(modelTicket, testdata.Agent.ID, testdata.SupportTopic.ID)
assert.Equal(t, models.TicketEventTypeTopicChanged, e6.EventType())
assert.Equal(t, testdata.SupportTopic.ID, e6.TopicID())
assert.Equal(t, testdata.Agent.ID, e6.CreatedByID())

err := models.InsertTicketEvents(ctx, db, []*models.TicketEvent{e1, e2, e3, e4, e5})
require.NoError(t, err)

Expand Down
60 changes: 53 additions & 7 deletions core/models/tickets.go
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ func updateTicketLastActivity(ctx context.Context, db Queryer, ids []TicketID, n
return Exec(ctx, "update ticket last activity", db, `UPDATE tickets_ticket SET last_activity_on = $2 WHERE id = ANY($1)`, pq.Array(ids), now)
}

const assignTicketSQL = `
const ticketsAssignSQL = `
UPDATE
tickets_ticket
SET
Expand All @@ -391,8 +391,8 @@ WHERE
id = ANY($1)
`

// AssignTickets assigns the passed in tickets
func AssignTickets(ctx context.Context, db Queryer, oa *OrgAssets, userID UserID, tickets []*Ticket, assigneeID UserID, note string) (map[*Ticket]*TicketEvent, error) {
// TicketsAssign assigns the passed in tickets
func TicketsAssign(ctx context.Context, db Queryer, oa *OrgAssets, userID UserID, tickets []*Ticket, assigneeID UserID, note string) (map[*Ticket]*TicketEvent, error) {
ids := make([]TicketID, 0, len(tickets))
events := make([]*TicketEvent, 0, len(tickets))
eventsByTicket := make(map[*Ticket]*TicketEvent, len(tickets))
Expand All @@ -413,7 +413,7 @@ func AssignTickets(ctx context.Context, db Queryer, oa *OrgAssets, userID UserID
}

// mark the tickets as assigned in the db
err := Exec(ctx, "assign tickets", db, assignTicketSQL, pq.Array(ids), assigneeID, now)
err := Exec(ctx, "assign tickets", db, ticketsAssignSQL, pq.Array(ids), assigneeID, now)
if err != nil {
return nil, errors.Wrapf(err, "error updating tickets")
}
Expand All @@ -426,13 +426,13 @@ func AssignTickets(ctx context.Context, db Queryer, oa *OrgAssets, userID UserID
return eventsByTicket, nil
}

// NoteTickets adds a note to the passed in tickets
func NoteTickets(ctx context.Context, db Queryer, oa *OrgAssets, userID UserID, tickets []*Ticket, note string) (map[*Ticket]*TicketEvent, error) {
// TicketsAddNote adds a note to the passed in tickets
func TicketsAddNote(ctx context.Context, db Queryer, oa *OrgAssets, userID UserID, tickets []*Ticket, note string) (map[*Ticket]*TicketEvent, error) {
events := make([]*TicketEvent, 0, len(tickets))
eventsByTicket := make(map[*Ticket]*TicketEvent, len(tickets))

for _, ticket := range tickets {
e := NewTicketNoteEvent(ticket, userID, note)
e := NewTicketNoteAddedEvent(ticket, userID, note)
events = append(events, e)
eventsByTicket[ticket] = e
}
Expand All @@ -450,6 +450,52 @@ func NoteTickets(ctx context.Context, db Queryer, oa *OrgAssets, userID UserID,
return eventsByTicket, nil
}

const ticketsChangeTopicSQL = `
UPDATE
tickets_ticket
SET
topic_id = $2,
modified_on = $3,
last_activity_on = $3
WHERE
id = ANY($1)
`

// TicketsChangeTopic changes the topic of the passed in tickets
func TicketsChangeTopic(ctx context.Context, db Queryer, oa *OrgAssets, userID UserID, tickets []*Ticket, topicID TopicID) (map[*Ticket]*TicketEvent, error) {
ids := make([]TicketID, 0, len(tickets))
events := make([]*TicketEvent, 0, len(tickets))
eventsByTicket := make(map[*Ticket]*TicketEvent, len(tickets))
now := dates.Now()

for _, ticket := range tickets {
if ticket.TopicID() != topicID {
ids = append(ids, ticket.ID())
t := &ticket.t
t.TopicID = topicID
t.ModifiedOn = now
t.LastActivityOn = now

e := NewTicketTopicChangedEvent(ticket, userID, topicID)
events = append(events, e)
eventsByTicket[ticket] = e
}
}

// mark the tickets as assigned in the db
err := Exec(ctx, "change tickets topic", db, ticketsChangeTopicSQL, pq.Array(ids), topicID, now)
if err != nil {
return nil, errors.Wrapf(err, "error updating tickets")
}

err = InsertTicketEvents(ctx, db, events)
if err != nil {
return nil, errors.Wrapf(err, "error inserting ticket events")
}

return eventsByTicket, nil
}

const closeTicketSQL = `
UPDATE
tickets_ticket
Expand Down
36 changes: 18 additions & 18 deletions core/models/tickets_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ func TestUpdateTicketConfig(t *testing.T) {

defer deleteTickets(db)

ticket := testdata.InsertOpenTicket(db, testdata.Org1, testdata.Cathy, testdata.Mailgun, "Problem", "Where my shoes", "123", nil)
ticket := testdata.InsertOpenTicket(db, testdata.Org1, testdata.Cathy, testdata.Mailgun, testdata.DefaultTopic, "Problem", "Where my shoes", "123", nil)
modelTicket := ticket.Load(db)

// empty configs are null
Expand All @@ -170,7 +170,7 @@ func TestUpdateTicketLastActivity(t *testing.T) {
defer dates.SetNowSource(dates.DefaultNowSource)
dates.SetNowSource(dates.NewFixedNowSource(now))

ticket := testdata.InsertOpenTicket(db, testdata.Org1, testdata.Cathy, testdata.Mailgun, "Problem", "Where my shoes", "123", nil)
ticket := testdata.InsertOpenTicket(db, testdata.Org1, testdata.Cathy, testdata.Mailgun, testdata.DefaultTopic, "Problem", "Where my shoes", "123", nil)
modelTicket := ticket.Load(db)

models.UpdateTicketLastActivity(ctx, db, []*models.Ticket{modelTicket})
Expand All @@ -189,15 +189,15 @@ func TestAssignTickets(t *testing.T) {
oa, err := models.GetOrgAssetsWithRefresh(ctx, db, testdata.Org1.ID, models.RefreshTicketers)
require.NoError(t, err)

ticket1 := testdata.InsertClosedTicket(db, testdata.Org1, testdata.Cathy, testdata.Mailgun, "Problem", "Where my shoes", "123", nil)
ticket1 := testdata.InsertClosedTicket(db, testdata.Org1, testdata.Cathy, testdata.Mailgun, testdata.DefaultTopic, "Problem", "Where my shoes", "123", nil)
modelTicket1 := ticket1.Load(db)

ticket2 := testdata.InsertOpenTicket(db, testdata.Org1, testdata.Cathy, testdata.Zendesk, "Old Problem", "Where my pants", "234", nil)
ticket2 := testdata.InsertOpenTicket(db, testdata.Org1, testdata.Cathy, testdata.Zendesk, testdata.DefaultTopic, "Old Problem", "Where my pants", "234", nil)
modelTicket2 := ticket2.Load(db)

testdata.InsertOpenTicket(db, testdata.Org1, testdata.Cathy, testdata.Mailgun, "Ignore", "", "", nil)
testdata.InsertOpenTicket(db, testdata.Org1, testdata.Cathy, testdata.Mailgun, testdata.DefaultTopic, "Ignore", "", "", nil)

evts, err := models.AssignTickets(ctx, db, oa, testdata.Admin.ID, []*models.Ticket{modelTicket1, modelTicket2}, testdata.Agent.ID, "please handle these")
evts, err := models.TicketsAssign(ctx, db, oa, testdata.Admin.ID, []*models.Ticket{modelTicket1, modelTicket2}, testdata.Agent.ID, "please handle these")
require.NoError(t, err)
assert.Equal(t, 2, len(evts))
assert.Equal(t, models.TicketEventTypeAssigned, evts[modelTicket1].EventType())
Expand All @@ -211,27 +211,27 @@ func TestAssignTickets(t *testing.T) {
testsuite.AssertQuery(t, db, `SELECT count(*) FROM tickets_ticketevent WHERE event_type = 'A' AND note = 'please handle these'`).Returns(2)
}

func TestNoteTickets(t *testing.T) {
func TestTicketsAddNote(t *testing.T) {
ctx, _, db, _ := testsuite.Get()

defer deleteTickets(db)

oa, err := models.GetOrgAssetsWithRefresh(ctx, db, testdata.Org1.ID, models.RefreshTicketers)
require.NoError(t, err)

ticket1 := testdata.InsertClosedTicket(db, testdata.Org1, testdata.Cathy, testdata.Mailgun, "Problem", "Where my shoes", "123", nil)
ticket1 := testdata.InsertClosedTicket(db, testdata.Org1, testdata.Cathy, testdata.Mailgun, testdata.DefaultTopic, "Problem", "Where my shoes", "123", nil)
modelTicket1 := ticket1.Load(db)

ticket2 := testdata.InsertOpenTicket(db, testdata.Org1, testdata.Cathy, testdata.Zendesk, "Old Problem", "Where my pants", "234", nil)
ticket2 := testdata.InsertOpenTicket(db, testdata.Org1, testdata.Cathy, testdata.Zendesk, testdata.DefaultTopic, "Old Problem", "Where my pants", "234", nil)
modelTicket2 := ticket2.Load(db)

testdata.InsertOpenTicket(db, testdata.Org1, testdata.Cathy, testdata.Mailgun, "Ignore", "", "", nil)
testdata.InsertOpenTicket(db, testdata.Org1, testdata.Cathy, testdata.Mailgun, testdata.DefaultTopic, "Ignore", "", "", nil)

evts, err := models.NoteTickets(ctx, db, oa, testdata.Admin.ID, []*models.Ticket{modelTicket1, modelTicket2}, "spam")
evts, err := models.TicketsAddNote(ctx, db, oa, testdata.Admin.ID, []*models.Ticket{modelTicket1, modelTicket2}, "spam")
require.NoError(t, err)
assert.Equal(t, 2, len(evts))
assert.Equal(t, models.TicketEventTypeNote, evts[modelTicket1].EventType())
assert.Equal(t, models.TicketEventTypeNote, evts[modelTicket2].EventType())
assert.Equal(t, models.TicketEventTypeNoteAdded, evts[modelTicket1].EventType())
assert.Equal(t, models.TicketEventTypeNoteAdded, evts[modelTicket2].EventType())

// check there are new note events
testsuite.AssertQuery(t, db, `SELECT count(*) FROM tickets_ticketevent WHERE event_type = 'N' AND note = 'spam'`).Returns(2)
Expand All @@ -255,10 +255,10 @@ func TestCloseTickets(t *testing.T) {
oa, err := models.GetOrgAssetsWithRefresh(ctx, db, testdata.Org1.ID, models.RefreshTicketers)
require.NoError(t, err)

ticket1 := testdata.InsertOpenTicket(db, testdata.Org1, testdata.Cathy, testdata.Mailgun, "Problem", "Where my shoes", "123", nil)
ticket1 := testdata.InsertOpenTicket(db, testdata.Org1, testdata.Cathy, testdata.Mailgun, testdata.DefaultTopic, "Problem", "Where my shoes", "123", nil)
modelTicket1 := ticket1.Load(db)

ticket2 := testdata.InsertClosedTicket(db, testdata.Org1, testdata.Cathy, testdata.Zendesk, "Old Problem", "Where my pants", "234", nil)
ticket2 := testdata.InsertClosedTicket(db, testdata.Org1, testdata.Cathy, testdata.Zendesk, testdata.DefaultTopic, "Old Problem", "Where my pants", "234", nil)
modelTicket2 := ticket2.Load(db)

logger := &models.HTTPLogger{}
Expand All @@ -283,7 +283,7 @@ func TestCloseTickets(t *testing.T) {
testsuite.AssertQuery(t, db, `SELECT count(*) FROM tickets_ticketevent WHERE ticket_id = $1 AND event_type = 'C'`, ticket2.ID).Returns(0)

// can close tickets without a user
ticket3 := testdata.InsertOpenTicket(db, testdata.Org1, testdata.Cathy, testdata.Mailgun, "Problem", "Where my shoes", "123", nil)
ticket3 := testdata.InsertOpenTicket(db, testdata.Org1, testdata.Cathy, testdata.Mailgun, testdata.DefaultTopic, "Problem", "Where my shoes", "123", nil)
modelTicket3 := ticket3.Load(db)

evts, err = models.CloseTickets(ctx, db, oa, models.NilUserID, []*models.Ticket{modelTicket3}, false, logger)
Expand Down Expand Up @@ -312,10 +312,10 @@ func TestReopenTickets(t *testing.T) {
oa, err := models.GetOrgAssetsWithRefresh(ctx, db, testdata.Org1.ID, models.RefreshTicketers)
require.NoError(t, err)

ticket1 := testdata.InsertClosedTicket(db, testdata.Org1, testdata.Cathy, testdata.Mailgun, "Problem", "Where my shoes", "123", nil)
ticket1 := testdata.InsertClosedTicket(db, testdata.Org1, testdata.Cathy, testdata.Mailgun, testdata.DefaultTopic, "Problem", "Where my shoes", "123", nil)
modelTicket1 := ticket1.Load(db)

ticket2 := testdata.InsertOpenTicket(db, testdata.Org1, testdata.Cathy, testdata.Zendesk, "Old Problem", "Where my pants", "234", nil)
ticket2 := testdata.InsertOpenTicket(db, testdata.Org1, testdata.Cathy, testdata.Zendesk, testdata.DefaultTopic, "Old Problem", "Where my pants", "234", nil)
modelTicket2 := ticket2.Load(db)

logger := &models.HTTPLogger{}
Expand Down
2 changes: 1 addition & 1 deletion core/tasks/broadcasts/worker_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ func TestBroadcastTask(t *testing.T) {
// insert a broadcast so we can check it is being set to sent
legacyID := testdata.InsertBroadcast(db, testdata.Org1, "base", map[envs.Language]string{"base": "hi @(PROPER(contact.name)) legacy"}, models.NilScheduleID, nil, nil)

ticket := testdata.InsertOpenTicket(db, testdata.Org1, testdata.Cathy, testdata.Mailgun, "Problem", "", "", nil)
ticket := testdata.InsertOpenTicket(db, testdata.Org1, testdata.Cathy, testdata.Mailgun, testdata.DefaultTopic, "Problem", "", "", nil)
modelTicket := ticket.Load(db)

evaluated := map[envs.Language]*models.BroadcastTranslation{
Expand Down
Loading

0 comments on commit f888455

Please sign in to comment.