Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CreateSubscriptionRequest ¶
type CreateSubscriptionRequest struct {
UserID entities.UserID
Type entities.SubscriptionType
Endpoint string
Keys map[string]string
}
CreateSubscriptionRequest represents the input for creating a subscription
type CreateSubscriptionResponse ¶
type CreateSubscriptionResponse struct {
Subscription *entities.Subscription
}
CreateSubscriptionResponse represents the output of creating a subscription
type DeleteSubscriptionRequest ¶
type DeleteSubscriptionRequest struct {
SubscriptionID entities.SubscriptionID
UserID entities.UserID // For authorization
}
DeleteSubscriptionRequest represents the input for deleting a subscription
type DeleteSubscriptionResponse ¶
type DeleteSubscriptionResponse struct {
Success bool
}
DeleteSubscriptionResponse represents the output of deleting a subscription
type ManageSubscriptionUseCase ¶
type ManageSubscriptionUseCase struct {
// contains filtered or unexported fields
}
ManageSubscriptionUseCase handles notification subscription management
func NewManageSubscriptionUseCase ¶
func NewManageSubscriptionUseCase( notificationRepo repositories.NotificationRepository, userRepo repositories.UserRepository, notificationSvc services.NotificationService, ) *ManageSubscriptionUseCase
NewManageSubscriptionUseCase creates a new ManageSubscriptionUseCase
func (*ManageSubscriptionUseCase) CreateSubscription ¶
func (uc *ManageSubscriptionUseCase) CreateSubscription(ctx context.Context, req *CreateSubscriptionRequest) (*CreateSubscriptionResponse, error)
CreateSubscription creates a new notification subscription
func (*ManageSubscriptionUseCase) DeleteSubscription ¶
func (uc *ManageSubscriptionUseCase) DeleteSubscription(ctx context.Context, req *DeleteSubscriptionRequest) (*DeleteSubscriptionResponse, error)
DeleteSubscription deletes a notification subscription
type SendNotificationRequest ¶
type SendNotificationRequest struct {
UserID entities.UserID
Title string
Body string
URL *string
Tags entities.Tags
IconURL *string
}
SendNotificationRequest represents the input for sending a notification
type SendNotificationResponse ¶
type SendNotificationResponse struct {
Notification *entities.Notification
Results []*services.NotificationResult
SentCount int
FailedCount int
}
SendNotificationResponse represents the output of sending a notification
type SendNotificationUseCase ¶
type SendNotificationUseCase struct {
// contains filtered or unexported fields
}
SendNotificationUseCase handles sending notifications to users
func NewSendNotificationUseCase ¶
func NewSendNotificationUseCase( notificationRepo repositories.NotificationRepository, userRepo repositories.UserRepository, notificationSvc services.NotificationService, ) *SendNotificationUseCase
NewSendNotificationUseCase creates a new SendNotificationUseCase
func (*SendNotificationUseCase) Execute ¶
func (uc *SendNotificationUseCase) Execute(ctx context.Context, req *SendNotificationRequest) (*SendNotificationResponse, error)
Execute sends a notification to a user's subscriptions