Yimaru-BackEnd/internal/ports/notification.go
Yared Yemane 685e1d104f feat: add GET notification by ID endpoint
Expose read-only in-app notification details at GET /notifications/:id with owner scoping and list-all admin access.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-05 05:31:46 -07:00

32 lines
1.8 KiB
Go

package ports
import (
"context"
"Yimaru-Backend/internal/domain"
)
type NotificationStore interface {
GetNotification(ctx context.Context, id int64) (*domain.Notification, error)
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
}