forked from NdoleStudio/httpsms
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathphone_notification_repository.go
More file actions
28 lines (20 loc) · 1.08 KB
/
Copy pathphone_notification_repository.go
File metadata and controls
28 lines (20 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
package repositories
import (
"context"
"github.com/google/uuid"
"github.com/NdoleStudio/httpsms/pkg/entities"
)
// PhoneNotificationRepository loads and persists an entities.PhoneNotification
type PhoneNotificationRepository interface {
// Schedule a new entities.PhoneNotification
Schedule(ctx context.Context, messagesPerMinute uint, schedule *entities.MessageSendSchedule, notification *entities.PhoneNotification) error
// ScheduleExact stores a phone notification with a fixed ScheduledAt time,
// bypassing rate-limit and schedule window logic.
ScheduleExact(ctx context.Context, notification *entities.PhoneNotification) error
// UpdateStatus of a notification
UpdateStatus(ctx context.Context, notificationID uuid.UUID, status entities.PhoneNotificationStatus) error
// DeleteAllForUser deletes all entities.PhoneNotification for a user
DeleteAllForUser(ctx context.Context, userID entities.UserID) error
// DeleteByMessageID deletes entities.PhoneNotification for a message and user
DeleteByMessageID(ctx context.Context, userID entities.UserID, messageID uuid.UUID) error
}