Documentation
¶
Index ¶
- type NotificationService
- func (s *NotificationService) CountNotificationUnread(userID string, companyID string) (int64, error)
- func (s *NotificationService) CreateNotification(notification *models.NotificationModel) error
- func (s *NotificationService) CreateNotificationWithCallback(notification *models.NotificationModel, ...) error
- func (s *NotificationService) DeleteNotification(id string) error
- func (s *NotificationService) GetNotificationDetail(id string) (*models.NotificationModel, error)
- func (s *NotificationService) GetNotifications(request http.Request, search string, userID *string) (paginate.Page, error)
- func (s *NotificationService) MarkAsRead(id string) error
- func (s *NotificationService) Migrate() error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type NotificationService ¶
type NotificationService struct {
// contains filtered or unexported fields
}
NotificationService provides methods for managing notifications.
func NewNotificationService ¶
func NewNotificationService(ctx *context.ERPContext) *NotificationService
NewNotificationService creates a new instance of NotificationService. It initializes the service and performs migration if needed.
func (*NotificationService) CountNotificationUnread ¶
func (s *NotificationService) CountNotificationUnread(userID string, companyID string) (int64, error)
CountNotificationUnread counts unread notifications for a user and company.
func (*NotificationService) CreateNotification ¶
func (s *NotificationService) CreateNotification(notification *models.NotificationModel) error
CreateNotification creates a new notification record in the database.
func (*NotificationService) CreateNotificationWithCallback ¶
func (s *NotificationService) CreateNotificationWithCallback(notification *models.NotificationModel, callback func(notification *models.NotificationModel)) error
CreateNotificationWithCallback creates a notification and executes a callback on success.
func (*NotificationService) DeleteNotification ¶
func (s *NotificationService) DeleteNotification(id string) error
DeleteNotification deletes a notification by ID.
func (*NotificationService) GetNotificationDetail ¶
func (s *NotificationService) GetNotificationDetail(id string) (*models.NotificationModel, error)
GetNotificationDetail retrieves notification details by ID.
func (*NotificationService) GetNotifications ¶
func (s *NotificationService) GetNotifications(request http.Request, search string, userID *string) (paginate.Page, error)
GetNotifications retrieves paginated notifications based on search criteria.
func (*NotificationService) MarkAsRead ¶
func (s *NotificationService) MarkAsRead(id string) error
MarkAsRead marks a notification as read by ID.
func (*NotificationService) Migrate ¶
func (s *NotificationService) Migrate() error
Migrate performs the database migration for the NotificationModel.