refactor: simplify service interface to use tags/rels for all node properties

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-31 23:10:56 +02:00
parent 4404518f50
commit cb16bda200
5 changed files with 151 additions and 147 deletions

View File

@@ -1,6 +1,7 @@
package cmd
import (
"axolotl/models"
"axolotl/output"
"axolotl/service"
"fmt"
@@ -22,13 +23,27 @@ var listCmd = &cobra.Command{
}
filter := service.ListFilter{
Tags: lTags,
Status: lStatus,
Priority: lPrio,
Type: lType,
Namespace: lNamespace,
Assignee: lAssignee,
Mention: lMention,
Tags: append([]string{}, lTags...),
}
// Shorthand flags expand to tag prefixes or rel filters.
if lStatus != "" {
filter.Tags = append(filter.Tags, "_status::"+lStatus)
}
if lPrio != "" {
filter.Tags = append(filter.Tags, "_prio::"+lPrio)
}
if lType != "" {
filter.Tags = append(filter.Tags, "_type::"+lType)
}
if lNamespace != "" {
filter.Rels = append(filter.Rels, service.RelInput{Type: models.RelInNamespace, Target: lNamespace})
}
if lAssignee != "" {
filter.Rels = append(filter.Rels, service.RelInput{Type: models.RelAssignee, Target: lAssignee})
}
if lMention != "" {
filter.Rels = append(filter.Rels, service.RelInput{Type: models.RelMentions, Target: lMention})
}
for _, r := range lRels {