Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: store recipient details in notification send history #1233

Merged
merged 1 commit into from
Dec 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading