Add per-user notification time preferences
Allow users to customize when they receive notification reminders: - Add task_due_soon_hour, task_overdue_hour, warranty_expiring_hour fields - Store times in UTC, clients convert to/from local timezone - Worker runs hourly, queries only users scheduled for that hour - Early exit optimization when no users need notifications - Admin UI displays custom notification times 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -23,6 +23,12 @@ type NotificationPreference struct {
|
||||
|
||||
// Email preferences
|
||||
EmailTaskCompleted bool `gorm:"column:email_task_completed;default:true" json:"email_task_completed"`
|
||||
|
||||
// Custom notification times (nullable, stored as UTC hour 0-23)
|
||||
// When nil, system defaults from config are used
|
||||
TaskDueSoonHour *int `gorm:"column:task_due_soon_hour" json:"task_due_soon_hour"`
|
||||
TaskOverdueHour *int `gorm:"column:task_overdue_hour" json:"task_overdue_hour"`
|
||||
WarrantyExpiringHour *int `gorm:"column:warranty_expiring_hour" json:"warranty_expiring_hour"`
|
||||
}
|
||||
|
||||
// TableName returns the table name for GORM
|
||||
|
||||
Reference in New Issue
Block a user