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:
@@ -24,56 +24,37 @@ type NodeService interface {
|
||||
}
|
||||
|
||||
// AddInput describes a new node to create.
|
||||
// Tags may include special property tags (_type::, _status::, _prio::); the
|
||||
// service applies defaults (type=issue, status=open for issues) and validates.
|
||||
// Rels may include assignee, in_namespace, blocks, subtask, related, etc.;
|
||||
// user and namespace targets are auto-created as needed.
|
||||
type AddInput struct {
|
||||
Title string
|
||||
Content string
|
||||
DueDate string
|
||||
Type string // default: "issue"
|
||||
Status string // default: "open" when Type is "issue"
|
||||
Priority string
|
||||
// Namespace is a namespace name or node ID. Defaults to the current user.
|
||||
Namespace string
|
||||
// Assignee is a username or node ID.
|
||||
Assignee string
|
||||
// Tags are arbitrary user-defined labels (not system properties).
|
||||
Tags []string
|
||||
// Rels are additional typed edges (e.g. blocks, subtask, related).
|
||||
Rels []RelInput
|
||||
Title string
|
||||
Content string
|
||||
DueDate string
|
||||
Tags []string
|
||||
Rels []RelInput
|
||||
}
|
||||
|
||||
// UpdateInput describes changes to apply to an existing node.
|
||||
// Nil pointer fields mean "no change".
|
||||
// Setting _status::done in AddTags is rejected when the node has open blockers.
|
||||
// Adding assignee or in_namespace rels replaces the previous single target.
|
||||
type UpdateInput struct {
|
||||
Title *string
|
||||
Content *string
|
||||
DueDate *string // nil = no change; pointer to "" = clear due date
|
||||
// Status "done" is rejected when the node has open blockers.
|
||||
Status *string
|
||||
Priority *string
|
||||
Type *string
|
||||
// Namespace replaces the current namespace.
|
||||
Namespace *string
|
||||
// Assignee replaces the current assignee.
|
||||
Assignee *string
|
||||
Title *string
|
||||
Content *string
|
||||
DueDate *string // nil = no change; pointer to "" = clear due date
|
||||
AddTags []string
|
||||
RemoveTags []string
|
||||
AddRels []RelInput
|
||||
RemoveRels []RelInput
|
||||
}
|
||||
|
||||
// ListFilter specifies which nodes to return. Empty fields are ignored.
|
||||
// ListFilter specifies which nodes to return. Empty slices are ignored.
|
||||
// Tags are matched as exact tag values or prefixes (e.g. "_status::open").
|
||||
// Rels are resolved to node IDs; a missing target returns no results.
|
||||
type ListFilter struct {
|
||||
Tags []string
|
||||
Status string
|
||||
Priority string
|
||||
Type string
|
||||
// Namespace filters by namespace name or node ID.
|
||||
Namespace string
|
||||
// Assignee filters by username or node ID.
|
||||
Assignee string
|
||||
// Mention filters to nodes that mention the given username or node ID.
|
||||
Mention string
|
||||
// Rels are additional relation filters (e.g. blocks:someID).
|
||||
Tags []string
|
||||
Rels []RelInput
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user