forked from tangled.org/core
Monorepo for Tangled — https://tangled.org
1package models 2 3import "time" 4 5type NotificationType string 6 7const ( 8 NotificationTypeRepoStarred NotificationType = "repo_starred" 9 NotificationTypeIssueCreated NotificationType = "issue_created" 10 NotificationTypeIssueCommented NotificationType = "issue_commented" 11 NotificationTypePullCreated NotificationType = "pull_created" 12 NotificationTypePullCommented NotificationType = "pull_commented" 13 NotificationTypeFollowed NotificationType = "followed" 14 NotificationTypePullMerged NotificationType = "pull_merged" 15 NotificationTypeIssueClosed NotificationType = "issue_closed" 16 NotificationTypePullClosed NotificationType = "pull_closed" 17) 18 19type Notification struct { 20 ID int64 21 RecipientDid string 22 ActorDid string 23 Type NotificationType 24 EntityType string 25 EntityId string 26 Read bool 27 Created time.Time 28 29 // foreign key references 30 RepoId *int64 31 IssueId *int64 32 PullId *int64 33} 34 35type NotificationWithEntity struct { 36 *Notification 37 Repo *Repo 38 Issue *Issue 39 Pull *Pull 40} 41 42type NotificationPreferences struct { 43 ID int64 44 UserDid string 45 RepoStarred bool 46 IssueCreated bool 47 IssueCommented bool 48 PullCreated bool 49 PullCommented bool 50 Followed bool 51 PullMerged bool 52 IssueClosed bool 53 EmailNotifications bool 54}