Changeset 0.20.0 (#85)

This commit is contained in:
2026-03-01 12:40:15 +00:00
parent eb74180611
commit 817062e5fc
57 changed files with 5435 additions and 72 deletions

View 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}