summaryrefslogtreecommitdiff
path: root/internal/models
diff options
context:
space:
mode:
authorPeter Stone <thepeterstone@gmail.com>2026-07-17 22:46:18 +0000
committerPeter Stone <thepeterstone@gmail.com>2026-07-17 22:46:18 +0000
commitbe4d606e9a1f5b068abcc21bbac58d1e4705ea1f (patch)
tree220aea277125aee4aa35a10201ab0a8a6c1caf89 /internal/models
parent9460b768335dcaf7f89020caf00f1a125de14b20 (diff)
Extend chain creation to accept per-task description and priority
CreateChain and POST /api/widget/chains previously only took bare title strings, with priority hardcoded to 1 -- narrower than the spec's "an ordered list of task titles/descriptions" API line. Now accepts []models.ChainTaskInput{Content, Description, Priority} per position, priority defaulting to 1 when omitted. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EZ7ikw2ukGJFTHE3bJS7zL
Diffstat (limited to 'internal/models')
-rw-r--r--internal/models/types.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/internal/models/types.go b/internal/models/types.go
index 8eda33b..aa65e18 100644
--- a/internal/models/types.go
+++ b/internal/models/types.go
@@ -51,6 +51,15 @@ type Chain struct {
CreatedAt time.Time `json:"created_at"`
}
+// ChainTaskInput seeds one position of a chain at creation time. Priority
+// of 0 (the zero value, JSON field omitted) defaults to 1, matching
+// CreateNativeTask's default.
+type ChainTaskInput struct {
+ Content string `json:"content"`
+ Description string `json:"description,omitempty"`
+ Priority int `json:"priority,omitempty"`
+}
+
// MaintenanceBucket is a finite pool of native tasks that get repeatedly
// activated/deactivated: every CycleDays, PickN dormant items are selected
// and flipped active with a computed due date.