service

package
v0.0.0-...-58afb8c Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2022 License: MIT Imports: 7 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 interface {
	SaveNotification(notification *dto.Notification) error
	FindOneNotification(filter interface{}) (*dto.Notification, error)
	FindNotificationList(filter interface{}, limit int64, skip int64, sort map[string]int) ([]dto.Notification, error)
	FindNotificationsReceiver(filter interface{}, limit int64, skip int64, sort map[string]int) ([]dto.Notification, error)
	FindById(objectId uuid.UUID) (*dto.Notification, error)
	FindByOwnerUserId(ownerUserId uuid.UUID) ([]dto.Notification, error)
	UpdateNotification(filter interface{}, data interface{}, opts ...*coreData.UpdateOptions) error
	UpdateNotificationById(data *dto.Notification) error
	UpdateBulkNotificationList(userNotification []dto.Notification) error
	UpdateEmailSent(notifyIds []uuid.UUID) error
	DeleteNotification(filter interface{}) error
	DeleteNotificationByOwner(notificationReceiverId uuid.UUID, notificationId uuid.UUID) error
	DeleteManyNotifications(filter interface{}) error
	CreateNotificationIndex(indexes map[string]interface{}) error
	GetNotificationByUserId(userId *uuid.UUID, sortBy string, page int64, limit int64) ([]dto.Notification, error)
	GetLastNotifications() ([]dto.Notification, error)
	SeenNotification(objectId uuid.UUID, userId uuid.UUID) error
	SeenAllNotifications(userId uuid.UUID) error
	DeleteNotificationsByUserId(userId uuid.UUID) error
}

func NewNotificationService

func NewNotificationService(db interface{}) (NotificationService, error)

NewNotificationService initializes NotificationService's dependencies and create new NotificationService struct

type NotificationServiceImpl

type NotificationServiceImpl struct {
	NotificationRepo repo.Repository
}

NotificationService handlers with injected dependencies

func (NotificationServiceImpl) CreateNotificationIndex

func (s NotificationServiceImpl) CreateNotificationIndex(indexes map[string]interface{}) error

CreateNotificationIndex create index for notification search.

func (NotificationServiceImpl) DeleteManyNotifications

func (s NotificationServiceImpl) DeleteManyNotifications(filter interface{}) error

DeleteManyNotifications delete many notifications by filter

func (NotificationServiceImpl) DeleteNotification

func (s NotificationServiceImpl) DeleteNotification(filter interface{}) error

DeleteNotification delete notification by filter

func (NotificationServiceImpl) DeleteNotificationByOwner

func (s NotificationServiceImpl) DeleteNotificationByOwner(notificationReceiverId uuid.UUID, notificationId uuid.UUID) error

DeleteNotification delete notification by notificationReceiverId and notificationId

func (NotificationServiceImpl) DeleteNotificationsByUserId

func (s NotificationServiceImpl) DeleteNotificationsByUserId(userId uuid.UUID) error

DeleteNotificationsByUserId delete notifications by userId

func (NotificationServiceImpl) FindById

func (s NotificationServiceImpl) FindById(objectId uuid.UUID) (*dto.Notification, error)

FindById find by notification id

func (NotificationServiceImpl) FindByOwnerUserId

func (s NotificationServiceImpl) FindByOwnerUserId(ownerUserId uuid.UUID) ([]dto.Notification, error)

FindByOwnerUserId find by owner user id

func (NotificationServiceImpl) FindNotificationList

func (s NotificationServiceImpl) FindNotificationList(filter interface{}, limit int64, skip int64, sort map[string]int) ([]dto.Notification, error)

FindNotificationList get all notifications by filter

func (NotificationServiceImpl) FindNotificationsReceiver

func (s NotificationServiceImpl) FindNotificationsReceiver(filter interface{}, limit int64, skip int64, sort map[string]int) ([]dto.Notification, error)

FindNotificationsReceiver get all notifications by filter including receiver profile

func (NotificationServiceImpl) FindOneNotification

func (s NotificationServiceImpl) FindOneNotification(filter interface{}) (*dto.Notification, error)

FindOneNotification get one notification

func (NotificationServiceImpl) GetLastNotifications

func (s NotificationServiceImpl) GetLastNotifications() ([]dto.Notification, error)

GetLastNotifications find by owner user id

func (NotificationServiceImpl) GetNotificationByUserId

func (s NotificationServiceImpl) GetNotificationByUserId(userId *uuid.UUID, sortBy string, page int64, limit int64) ([]dto.Notification, error)

GetNotificationByUserId get all notifications by userId who receive the notification

func (NotificationServiceImpl) SaveNotification

func (s NotificationServiceImpl) SaveNotification(notification *dto.Notification) error

SaveNotification save the notification

func (NotificationServiceImpl) SeenAllNotifications

func (s NotificationServiceImpl) SeenAllNotifications(userId uuid.UUID) error

SeenNotification update all notifications to seen

func (NotificationServiceImpl) SeenNotification

func (s NotificationServiceImpl) SeenNotification(objectId uuid.UUID, userId uuid.UUID) error

SeenNotification update the notification to seen

func (NotificationServiceImpl) UpdateBulkNotification

func (s NotificationServiceImpl) UpdateBulkNotification(bulk []data.BulkUpdateOne) error

UpdateBulkNotification update bulk notification

func (NotificationServiceImpl) UpdateBulkNotificationList

func (s NotificationServiceImpl) UpdateBulkNotificationList(userNotification []dto.Notification) error

UpdateBulkNotificationList update bulk notification list

func (NotificationServiceImpl) UpdateEmailSent

func (s NotificationServiceImpl) UpdateEmailSent(notifyIds []uuid.UUID) error

UpdateEmailSent update bulk notification list

func (NotificationServiceImpl) UpdateManyNotifications

func (s NotificationServiceImpl) UpdateManyNotifications(filter interface{}, data interface{}, opts ...*coreData.UpdateOptions) error

UpdateManyNotifications update many notifications

func (NotificationServiceImpl) UpdateNotification

func (s NotificationServiceImpl) UpdateNotification(filter interface{}, data interface{}, opts ...*coreData.UpdateOptions) error

UpdateNotification update the notification

func (NotificationServiceImpl) UpdateNotificationById

func (s NotificationServiceImpl) UpdateNotificationById(data *dto.Notification) error

UpdateNotificationById update the notification

Jump to

Keyboard shortcuts

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