feat(reminders): persist reminders in the db

This commit is contained in:
kolaente 2023-12-23 15:40:03 +01:00
parent d952bedce0
commit 32611dc2d7
Signed by untrusted user: konrad
GPG Key ID: F40E70337AB24C9B
1 changed files with 6 additions and 3 deletions

View File

@ -32,7 +32,7 @@ import (
// ReminderDueNotification represents a ReminderDueNotification notification // ReminderDueNotification represents a ReminderDueNotification notification
type ReminderDueNotification struct { type ReminderDueNotification struct {
User *user.User `json:"user"` User *user.User `json:"user,omitempty"`
Task *Task `json:"task"` Task *Task `json:"task"`
Project *Project `json:"project"` Project *Project `json:"project"`
} }
@ -50,12 +50,15 @@ func (n *ReminderDueNotification) ToMail() *notifications.Mail {
// ToDB returns the ReminderDueNotification notification in a format which can be saved in the db // ToDB returns the ReminderDueNotification notification in a format which can be saved in the db
func (n *ReminderDueNotification) ToDB() interface{} { func (n *ReminderDueNotification) ToDB() interface{} {
return nil return &ReminderDueNotification{
Task: n.Task,
Project: n.Project,
}
} }
// Name returns the name of the notification // Name returns the name of the notification
func (n *ReminderDueNotification) Name() string { func (n *ReminderDueNotification) Name() string {
return "" return "task.reminder"
} }
// TaskCommentNotification represents a TaskCommentNotification notification // TaskCommentNotification represents a TaskCommentNotification notification