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
+12
View File
@@ -135,6 +135,8 @@ type NotificationItem struct {
Status string `json:"status"`
ScheduledAt int64 `json:"scheduled_at"`
IsScheduled bool `json:"is_scheduled"`
Seen bool `json:"seen"`
SeenAt int64 `json:"seen_at"`
}
// NotificationListResponse represents the response from getting notifications list
@@ -162,3 +164,13 @@ type GetNotificationsRequest struct {
Page int `json:"page,omitempty" valid:"optional"`
PerPage int `json:"per_page,omitempty" valid:"optional"`
}
// MarkSeenRequest represents the request for marking a notification as seen
type MarkSeenRequest struct {
NotificationID string `json:"notification_id" valid:"required"`
}
// MarkSeenResponse represents the response from marking a notification as seen
type MarkSeenResponse struct {
Status string `json:"status"`
}