RezinaLMS-BackEnd/internal/ports/notification.go
Yared Yemane 10babe06f6 feat: add in-app notification delete APIs and fix FAQ RBAC access
- Add DELETE /notifications/:id and POST /notifications/delete-in-app for owned in-app rows

- Seed FAQ permissions for ADMIN/INSTRUCTOR, migration 000084, and improve RBAC sync

- Document FAQ admin panel integration

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-14 02:15:00 -07:00

34 lines
2.0 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
DeleteUserInAppNotification(ctx context.Context, id, userID int64) (int64, error)
DeleteUserInAppNotificationsByIDs(ctx context.Context, userID int64, ids []int64) (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
}