Yimaru-BackEnd/internal/ports/notification.go

31 lines
1.7 KiB
Go

package ports
import (
"context"
"Yimaru-Backend/internal/domain"
)
type NotificationStore interface {
GetUserNotifications(ctx context.Context, recipientID int64, limit, offset int) ([]domain.Notification, int64, error)
CountUnreadNotifications(ctx context.Context, recipient_id int64) (int64, error)
GetAllNotifications(ctx context.Context, limit, offset int) ([]domain.Notification, error)
GetFilteredNotifications(ctx context.Context, filter domain.NotificationFilter) ([]domain.Notification, int64, error)
CreateNotification(ctx context.Context, notification *domain.Notification) (*domain.Notification, error)
MarkNotificationAsRead(ctx context.Context, id int64) (*domain.Notification, error)
MarkAllUserNotificationsAsRead(ctx context.Context, userID int64) error
MarkNotificationAsUnread(ctx context.Context, id int64) (*domain.Notification, error)
MarkAllUserNotificationsAsUnread(ctx context.Context, userID int64) error
DeleteUserNotifications(ctx context.Context, userID int64) error
// Scheduled Notifications
CreateScheduledNotification(ctx context.Context, sn *domain.ScheduledNotification) (*domain.ScheduledNotification, error)
GetScheduledNotification(ctx context.Context, id int64) (*domain.ScheduledNotification, error)
ListScheduledNotifications(ctx context.Context, filter domain.ScheduledNotificationFilter) ([]domain.ScheduledNotification, int64, error)
CancelScheduledNotification(ctx context.Context, id int64) (*domain.ScheduledNotification, error)
ClaimDueScheduledNotifications(ctx context.Context, limit int32) ([]domain.ScheduledNotification, error)
MarkScheduledNotificationSent(ctx context.Context, id int64) error
MarkScheduledNotificationFailed(ctx context.Context, id int64, lastError string) error
}