Changeset 0.20.0 (#85)
This commit is contained in:
20
server/models/models_notification_pref.go
Normal file
20
server/models/models_notification_pref.go
Normal file
@@ -0,0 +1,20 @@
|
||||
package models
|
||||
|
||||
// NotificationPreference stores a user's per-type notification delivery preference.
|
||||
// Type "*" acts as a catch-all default for types without an explicit row.
|
||||
type NotificationPreference struct {
|
||||
ID string `json:"id" db:"id"`
|
||||
UserID string `json:"user_id" db:"user_id"`
|
||||
Type string `json:"type" db:"type"` // notification type or "*"
|
||||
InApp bool `json:"in_app" db:"in_app"` // show in-app bell/panel
|
||||
Email bool `json:"email" db:"email"` // send email
|
||||
}
|
||||
|
||||
// ResolvedPreference is the effective preference after resolution chain.
|
||||
type ResolvedPreference struct {
|
||||
InApp bool
|
||||
Email bool
|
||||
}
|
||||
|
||||
// SystemDefaultPreference is the fallback when no user preference exists.
|
||||
var SystemDefaultPreference = ResolvedPreference{InApp: true, Email: false}
|
||||
Reference in New Issue
Block a user