Skip to content

Commit

Permalink
feat: store recipient details in notification send history
Browse files Browse the repository at this point in the history
  • Loading branch information
adityathebe authored and moshloop committed Dec 26, 2024
1 parent 95d1b55 commit ec7dc8c
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 7 deletions.
12 changes: 9 additions & 3 deletions models/notifications.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,11 +109,17 @@ type NotificationSendHistory struct {
// ID of the resource this notification is for
ResourceID uuid.UUID `json:"resource_id"`

// ID of the person this notification is for.
PersonID *uuid.UUID `json:"person_id"`
// ID of the team this notification was dispatched to.
TeamID *uuid.UUID `json:"team_id,omitempty"`

// ID of the person this notification was dispatched to.
PersonID *uuid.UUID `json:"person_id,omitempty"`

// ID of the connection this notification was dispatched to.
ConnectionID *uuid.UUID `json:"connection_id,omitempty"`

// The run created by this notification
PlaybookRunID *uuid.UUID `json:"playbook_run_id"`
PlaybookRunID *uuid.UUID `json:"playbook_run_id,omitempty"`

timeStart time.Time
}
Expand Down
19 changes: 15 additions & 4 deletions schema/notifications.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -184,8 +184,19 @@ table "notification_send_history" {
comment = "The resource this notification is for"
}
column "person_id" {
null = true
type = uuid
null = true
type = uuid
comment = "recipient person"
}
column "team_id" {
null = true
type = uuid
comment = "recipient team"
}
column "connection_id" {
null = true
type = uuid
comment = "recipient connection"
}
column "playbook_run_id" {
null = true
Expand Down Expand Up @@ -247,8 +258,8 @@ table "notification_silences" {
type = text
}
column "selectors" {
null = true
type = jsonb
null = true
type = jsonb
comment = "list of resource selectors"
}
column "error" {
Expand Down

0 comments on commit ec7dc8c

Please sign in to comment.