notification

package
v1.0.68 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 22, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL