Fix assignee filter bug in List

This commit is contained in:
2026-03-29 18:58:34 +02:00
parent 9e8c37564f
commit 13b4c4b651
22 changed files with 939 additions and 555 deletions

33
service/node_service.go Normal file
View File

@@ -0,0 +1,33 @@
package service
import "axolotl/models"
type NodeService interface {
Create(title, content, dueDate string, tags []string, rels map[models.RelType][]string) (*models.Node, error)
Update(node *models.Node) error
Delete(id string) error
GetByID(id string) (*models.Node, error)
List(opts ...ListOption) ([]*models.Node, error)
Exists(id string) (bool, error)
CanClose(id string) (bool, []string, error)
}
type listFilter struct {
tagPrefixes []string
assignee string
mentionsUser string
}
type ListOption func(*listFilter)
func WithTags(prefixes ...string) ListOption {
return func(f *listFilter) { f.tagPrefixes = prefixes }
}
func WithAssignee(userID string) ListOption {
return func(f *listFilter) { f.assignee = userID }
}
func WithMentions(userID string) ListOption {
return func(f *listFilter) { f.mentionsUser = userID }
}