From be4d606e9a1f5b068abcc21bbac58d1e4705ea1f Mon Sep 17 00:00:00 2001 From: Peter Stone Date: Fri, 17 Jul 2026 22:46:18 +0000 Subject: 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 Claude-Session: https://claude.ai/code/session_01EZ7ikw2ukGJFTHE3bJS7zL --- internal/models/types.go | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'internal/models/types.go') 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. -- cgit v1.2.3