package notification import ( "context" "errors" ) var ErrDependencyUnavailable = errors.New("dependency unavailable") type Service struct { repo *Repository } func NewService(repo *Repository) *Service { return &Service{repo: repo} } func (s *Service) List(ctx context.Context, userID uint64, page, pageSize int) (*PaginatedResult, error) { if s.repo == nil { return nil, ErrDependencyUnavailable } return s.repo.List(ctx, userID, page, pageSize) } func (s *Service) MarkRead(ctx context.Context, userID uint64, id uint64) error { if s.repo == nil { return ErrDependencyUnavailable } return s.repo.MarkRead(ctx, userID, id) }