Add MarkSeen Functionality to Notification System

- Implemented the MarkSeen method in the notification client to mark notifications as seen, enhancing user interaction with notifications.
- Added MarkSeenRequest and MarkSeenResponse structs to facilitate the request and response handling for marking notifications.
- Updated the NotificationService interface to include the new MarkSeen method, ensuring consistency across the service layer.
- Enhanced the SDK with a QuickMarkSeen convenience method for easier usage in client applications.
- Included logging for successful and failed attempts to mark notifications as seen, improving traceability and debugging capabilities.
This commit is contained in:
n.nakhostin
2025-09-21 10:20:58 +03:30
parent fc687b116a
commit 0f981880b5
5 changed files with 90 additions and 0 deletions
+11
View File
@@ -79,6 +79,11 @@ func (s *SDK) GetNotifications(ctx context.Context, req *GetNotificationsRequest
return s.service.GetNotifications(ctx, req)
}
// MarkSeen marks a notification as seen
func (s *SDK) MarkSeen(ctx context.Context, notificationID string) (*MarkSeenResponse, error) {
return s.service.MarkSeen(ctx, notificationID)
}
// NewBuilder creates a new notification builder for fluent API usage
func (s *SDK) NewBuilder() Builder {
return s.service.(*Service).NewBuilder()
@@ -149,6 +154,12 @@ func (s *SDK) GetNotificationsByStatus(ctx context.Context, status string, page,
return s.GetNotifications(ctx, req)
}
// QuickMarkSeen marks a notification as seen (convenience method)
func (s *SDK) QuickMarkSeen(ctx context.Context, notificationID string) error {
_, err := s.MarkSeen(ctx, notificationID)
return err
}
// Batch operations for sending multiple notifications
// BatchRequest represents a batch notification request